Skip to content

Run Worker Task

Method: POST

Endpoint: /api/v2/worker-tasks/{workerTaskId}/runs

Authentication: Supports Authorization: Bearer <YOUR_API_KEY>, api-key: <YOUR_API_KEY>, and ?token=<YOUR_API_KEY>. Prefer Bearer token.

POST/api/v2/worker-tasks/{workerTaskId}/runsRun worker task
AuthenticationRequired

Stored only in this browser tab. Sent only to https://openapi.coreclaw.com.

Parameters
path · stringRequired

Saved Worker task template slug. Get it from the `data.list[].slug` field of `GET /api/v2/worker-tasks`. The playground prefills a sample slug; replace it with your own.

Request BodyRequiredapplication/json
FieldTypeRequiredDescription
callback_urlstringOptionalCallback URL. When provided, CoreClaw sends a POST request after the run status changes or finishes.
is_asyncbooleanOptional`true` submits asynchronously and does not wait for execution results; `false` waits for the run to finish. Defaults to `true`.
limitintegerOptionalResult limit for synchronous run. Constraints: default `20`; range 1-100.
offsetintegerOptionalResult offset for synchronous run. Constraints: default `0`; minimum 0.
Request body (JSON)

Use this endpoint to run a saved Worker task template.

  • workerTaskId is the saved task template slug.
ParameterRequiredTypeDescription
workerTaskIdYesstringSaved Worker task template slug. Get it from the data.list[].slug field of GET /api/v2/worker-tasks.

Send the request body with Content-Type: application/json. Required/Optional describes each field; the Try it Request Body badge shows whether the body itself is required.

FieldRequiredTypeDescription
callback_urlNostringCallback URL. When provided, CoreClaw sends a POST request after the run status changes or finishes.
is_asyncNobooleantrue submits asynchronously without waiting for results; false waits for the run to finish. Defaults to true. Sync mode waits at most 5 minutes; if the run has not finished by then, the request returns and you must poll status via the run query endpoint.
limitNointegerSynchronous result window size for runs or reruns. It only controls how many result rows are included in the synchronous response, not the full result set. Constraints: default 20; range 1-100.
offsetNointegerZero-based offset for the synchronous result window returned by runs or reruns. Constraints: default 0; minimum 0.
{
"callback_url": "https://client.example.com/openapi/callback",
"is_async": true,
"limit": 20,
"offset": 0
}
  • is_async: true submits the run asynchronously and returns without waiting for execution results. The response includes data.run_slug; then poll the run detail, log, and result endpoints.
  • is_async: false waits for the run to finish, equivalent to run-and-wait behavior. Use offset / limit to control the result window returned by the synchronous run.

⚠️ Sync wait limit: 5 minutes. When is_async: false, the platform waits for the run for up to 5 minutes at most. If the run has not finished within 5 minutes, the request returns anyway and the run keeps executing in the background — you must then use the run query endpoint to poll status, logs, and results by runId. For runs that may exceed 5 minutes, prefer is_async: true.

Terminal window
curl -X POST "https://openapi.coreclaw.com/api/v2/worker-tasks/YOUR_WORKER_TASK_ID/runs" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
--data '{"callback_url":"https://client.example.com/openapi/callback","is_async":true,"limit":20,"offset":0}'
{
"code": 0,
"data": {
"run_slug": "01KKDXV2G26BT7NH4ZQR2R4NPZ"
},
"message": "success",
"request_id": "req-123"
}
  • API v2 supports Bearer token, the legacy api-key header, and query token. Prefer Bearer token for new integrations.
  • When running a saved task, the request body controls execution mode, callback, and synchronous result window; the task input comes from the saved Worker task configuration.
  • Use limit and offset only to control the synchronous result window; they do not change the full result set produced by the task.
  • When callback_url is provided, CoreClaw sends callback notifications after status changes or completion. See Callback Notifications.
HTTP StatusApplication CodeMeaning
2000OK
40011000Bad Request
40112001Unauthorized
40411004Not Found
42211000Unprocessable Entity
42913000Too Many Requests
50010000Internal Server Error