Jobs
Run work later or in the background: scheduled jobs, results of long-running requests, and webhooks. Poll a long-running request for its result here, or get a webhook when it finishes.
Four kinds of object live here:
- A scheduled job runs one tool on one entity (often a message to an
agent) at a time you give, once or on a recurring schedule. It stays
pendinguntil its last occurrence has run or it is cancelled. It can be paused, resumed, rescheduled and test-run without side effects, or run now for real: a job that runs once is then used up, a recurring job keeps its schedule. - An asynchronous execution is a long-running request that answered
202 Acceptedwith an async id. Poll it here until it iscompletedorfailed; the protocol is described once, under Async operations in the API reference introduction. - A webhook subscription delivers
request.completedandrequest.failedevents for your organization's requests to an HTTPS endpoint, signed with a secret, so you need not poll. - A failed background task is work Hilus started for you after a request had answered (analysing a finished conversation, filling in a ticket, reading a stored file's text) that failed every attempt and stopped retrying. List it to see its error and the ids it concerns, and retry it once the cause is fixed.
Everything is scoped to the caller's organization. Managing webhook
subscriptions requires the admin:webhooks scope; listing them does
not. Use the entities resource instead to run a tool on an entity right
now with its full result, and the lab to test an agent.
Operations
- Cancel a scheduled job.
POST /Platform/jobs/cancel - Subscribe an endpoint to request webhooks.
POST /Platform/jobs/webhooks - List webhook subscriptions.
GET /Platform/jobs/webhooks - Delete a webhook subscription.
POST /Platform/jobs/webhooks/delete - Run a tool on an entity, now or on a schedule.
POST /Platform/jobs/execute-tool - Send an agent a message, now or on a schedule.
POST /Platform/jobs/invoke-agent - List background tasks that stopped retrying.
GET /Platform/jobs/failed-tasks - List pending scheduled jobs.
GET /Platform/jobs - List a webhook's delivery attempts.
GET /Platform/jobs/webhooks/{webhook_id}/deliveries - Poll an asynchronous execution.
GET /Platform/jobs/async/{async_id} - Redeliver a webhook event.
POST /Platform/jobs/webhooks/{webhook_id}/redeliver - Change when a scheduled job runs.
POST /Platform/jobs/reschedule - Retry a background task that stopped retrying.
POST /Platform/jobs/failed-tasks/retry - Rotate a webhook signing secret.
POST /Platform/jobs/webhooks/{webhook_id}/rotate-secret - Run a scheduled job now, for real.
POST /Platform/jobs/run-now - Pause or resume a scheduled job.
POST /Platform/jobs/set-active - Test-run a scheduled job now, as a dry run.
POST /Platform/jobs/simulate - Verify a webhook endpoint.
POST /Platform/jobs/webhooks/{webhook_id}/verify
Objects
AsyncCompleted
async_id: str. Execution identifier.path: str or null. Original route template.request_path: str or null. Original requested path.mode: "sync" or "async" or null. Original dispatch mode.created_at: float or null. Execution creation time as Unix seconds.status: "completed". Execution completed.result: str or null. Complete serialized handler result.result_ref: optional str or null. Handle of the stored result when it was too large to keep on the record;resultis read through it.latency_ms: float or null. Execution duration in milliseconds.completed_at: float or null. Completion time as Unix seconds.
AsyncFailed
async_id: str. Execution identifier.path: str or null. Original route template.request_path: str or null. Original requested path.mode: "sync" or "async" or null. Original dispatch mode.created_at: float or null. Execution creation time as Unix seconds.status: "failed". The original execution failed.failure: ExecutionFailure. Failure of the original execution, not the poll request.completed_at: float or null. Completion time as Unix seconds.
AsyncPending
async_id: str. Execution identifier.path: str or null. Original route template.request_path: str or null. Original requested path.mode: "sync" or "async" or null. Original dispatch mode.created_at: float or null. Execution creation time as Unix seconds.status: "pending". Execution is still pending.poll_url: str. URL for polling this execution.
FailedTask
id: str. Failed task identifier; pass it to retry the task.description: str. What the task does, in plain words.failed_at: moment. When the last attempt failed and retrying stopped.first_scheduled_at: moment. When the task was first scheduled.attempts: int. Attempts made before retrying stopped.last_error: str. First line of the last attempt's error, at most 300 characters.references: List[FailedTaskReference]. Ids the task was working on (a conversation, a ticket, a call), to find what it concerns.
FailedTaskRetry
status: "retrying" or "not_found". retrying: the task runs again shortly; not_found: no failed task of your organization has this id.id: str. Requested failed task identifier.
JobCancellation
status: "cancelled" or "not_found". Whether a job was cancelled or was absent.
JobMissing
status: "not_found". The requested job does not exist.id: str. Requested job identifier.
JobRun
status: "ran" or "failed" or "started". Whether the tool completed or failed; started when it runs on in the background (an agent turn), its outcome recorded on the job.job_id: str. The ScheduledJob that ran.tool: str. Invoked tool name.result: optional JsonValue. Tool result encoded as public JSON, when it ran.failure: optional str or null. Tool failure message when status is failed.job_status: optional "pending" or "done" or null. The job's status after the run: done for a one-off.next_run_at: optional moment or null. Next scheduled occurrence as an ISO timestamp, if any.
JobSimulation
status: "ran" or "failed". Whether the stored invocation completed or the tool failed.job_id: str. Simulated ScheduledJob identifier.mocked: bool. Whether irreversible operations were mocked.tool: str. Invoked tool name.target: str. Target entity type and identifier.mock_applied_to_entities: int or null. Number of entities marked for mocking.result: optional JsonValue. Tool result encoded as public JSON, including media references.failure: optional str or null. Tool failure message when status is failed.conversation_id: optional str or null. Conversation started by an agent invocation.schedule_unchanged: bool. Whether the next scheduled occurrence remained unchanged.next_run_at: moment or null. Next scheduled occurrence as an ISO timestamp.
JobUpdated
status: "updated". The update was stored.id: str. Updated job identifier.active: bool. Whether scheduled occurrences may run.next_run_at: moment or null. Next occurrence as an ISO timestamp, if set.
ScheduledJobSummary
id: str. Scheduled job identifier.next_run_at: moment or null. Next occurrence as an ISO timestamp, if set.status: "pending" or "done". Job lifecycle state.active: bool. Whether occurrences are enabled.description: str or null. Human-readable purpose of the job.reference_id: str or null. Caller-provided deduplication identifier.source_conversation_id: str or null. Id of the conversation the job was scheduled from (an agent's turn, an inbound email).batch_id: optional str or null. The batch the job was created in, shared by the jobs an agent queued together.
ToolExecutionReceipt
id: str or null. Execution or scheduled-job identifier, when available.scheduled: bool. Whether the execution was scheduled for later.
WebhookCreated
id: str. Webhook subscription identifier.secret: str. New signing secret; store it securely when issued.verification: "pending". Endpoint verification has not completed.
WebhookDeletion
status: "deleted" or "not_found". Whether the subscription was deleted or absent.
WebhookDeliveryPage
deliveries: List[WebhookDelivery]. Attempts, newest first.next_before: int or null. Pass asbeforefor the next older page; null on the last page.
WebhookRedelivery
status: "scheduled". The attempt has been scheduled.job_id: str. Durable delivery attempt identifier.
WebhookSecret
id: str. Webhook subscription identifier.secret: str. New signing secret; store it securely when issued.
WebhookSummary
id: str. Webhook subscription identifier.url: str. HTTPS delivery endpoint.enabled: bool. Whether delivery is enabled.verification_status: "pending_verification" or "verified". Endpoint verification state.paths: List[str]. Route glob patterns; empty matches every route.events: List[str]. Subscribed request events; empty matches both outcomes.payload_mode: "full" or "thin". Whether deliveries include the stored result.consecutive_failures: int. Consecutive unsuccessful deliveries.disabled_reason: str or null. Reason for automatic disabling, if any.
WebhookVerification
status: "verified" or "failed". Whether the remote endpoint echoed the challenge.