Run a tool on an entity, now or on a schedule
POST /Platform/jobs/execute-tool
Run a tool on an entity, now or on a schedule.
Without when the tool runs now and the receipt names the
execution, not the tool's result (run a tool through the entities
resource to read its result); with when a ScheduledJob is
created and the receipt names the job (list, pause, test-run or
cancel it with the other routes here). The tool runs with its real
side effects: an irreversible tool (sending a message, charging a
card) is not mocked. To test-run a job first, create it and use the
job simulation route.
A scheduled job runs as you, with your access when it runs (and, when you schedule it with an API key, that key's): a route you could not call yourself is refused, and the job is paused if you leave the organization or the key is revoked.
Body parameters
target_type: str. Entity class name of the target (e.g. "Agent", "EvetPracticePims").target_id: str. The target entity's id.tool: str. The tool/method name to call on the target.arguments: optional dict. Arguments to pass to the tool.when: optional str. Optional time. Omit to run now; provide to schedule. Accepts an explicit ISO datetime (preferred for scripts: unambiguous, no parsing), or natural language — one-off ("tomorrow 9am") or recurring ("every monday", "every 30 minutes"). Natural language is LLM-parsed: relative phrases can resolve to a past instant (the job then runs immediately), so machine callers should pass ISO. For a perpetual fixed-interval polling job, schedule a one-off and setretry_lease_secondson the created ScheduledJob before it first fires (see that field's docs).state: optional str. Optional note for a scheduled job's runs (a cursor, what is done), at most 8192 characters. An agent's turn started by the job sees it after its message and can replace it. Ignored withoutwhen.
Returns
ToolExecutionReceipt
id: str or null. Execution or scheduled-job identifier, when available.scheduled: bool. Whether the execution was scheduled for later.
Example request
curl -X POST "https://api.hilus.ai/Platform/jobs/execute-tool" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'