Workers
Create, retrieve, and manage agent worker templates.
Create a worker template
client.workers.create(WorkerCreateParams { instructions, outputSchema, prompt, 3 more } body, RequestOptionsoptions?): WorkerTemplate { id, createdAt, instructions, 8 more }
POST/api/workers
Retrieve a worker
client.workers.retrieve(stringworkerID, WorkerRetrieveParams { taskId } query?, RequestOptionsoptions?): Worker { id, created_at, error, 13 more }
GET/api/workers/{workerId}
Update a worker template
client.workers.update(stringworkerID, WorkerUpdateParams { instructions, outputSchema, summary, 2 more } body, RequestOptionsoptions?): WorkerTemplate { id, createdAt, instructions, 8 more }
PATCH/api/workers/{workerId}
Delete a worker template
client.workers.delete(stringworkerID, RequestOptionsoptions?): DeleteWorkerResponse { deleted }
DELETE/api/workers/{workerId}
Retrieve a worker email address
client.workers.retrieveEmail(stringworkerID, RequestOptionsoptions?): WorkerRetrieveEmailResponse { email }
GET/api/workers/{workerId}/email
WorkersSchedules
Manage future and recurring worker tasks.
List worker schedules
client.workers.schedules.list(stringworkerID, RequestOptionsoptions?): ScheduleListResponse { schedules, timezone, workerId }
GET/api/workers/{workerId}/schedules
Create a worker schedule
client.workers.schedules.create(stringworkerID, ScheduleCreateParams { input, when, budget } body, RequestOptionsoptions?): WorkerSchedule
POST/api/workers/{workerId}/schedules
Cancel a worker schedule
client.workers.schedules.cancel(stringscheduleID, ScheduleCancelParams { workerId } params, RequestOptionsoptions?): ScheduleCancelResponse { cancelled }
DELETE/api/workers/{workerId}/schedules/{scheduleId}
WorkersWebhooks
Configure outbound webhooks delivered when a worker’s tasks complete.
Retrieve a worker webhook
client.workers.webhooks.retrieve(stringworkerID, RequestOptionsoptions?): Webhook { token, url }
GET/api/workers/{workerId}/webhook
Update a worker webhook
client.workers.webhooks.update(stringworkerID, WebhookUpdateParams { url } body, RequestOptionsoptions?): Webhook { token, url }
PUT/api/workers/{workerId}/webhook
Delete a worker webhook
client.workers.webhooks.delete(stringworkerID, RequestOptionsoptions?): Webhook { token, url }
DELETE/api/workers/{workerId}/webhook
Regenerate a worker webhook token
client.workers.webhooks.regenerateToken(stringworkerID, RequestOptionsoptions?): Webhook { token, url }
POST/api/workers/{workerId}/webhook/regenerate-token
List worker webhook executions
client.workers.webhooks.listExecutions(stringworkerID, WebhookListExecutionsParams { page } query?, RequestOptionsoptions?): WebhookExecutionList { logs, page, pageCount, totalCount }
GET/api/workers/{workerId}/webhook/executions