Tasks
Cancel Task
Cancel a running task or rename a task’s chat title. Use action: ‘cancel’ to stop execution.
PATCH
This endpoint allows you to cancel a running task or rename its chat title. When cancelling, the agent process is terminated and the run status is updated to
cancelled.
Authentication
To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:- Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
- Once provisioning completes, you will be redirected to your Dashboard
- From the Dashboard, create an API key to use with all Agent API requests
sk-xxxxxxxxxxxxxxxxxxxxxx
Headers
API Key of the form
Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560Must be set to
application/json.Path Parameters
The unique run identifier of the task to cancel or update.Example:
a1b2c3d4-e5f6-7890-abcd-ef1234567890Request Body
Action to perform. Use
"cancel" to stop the running task.Must be "cancel" when provided.New title for the task’s chat thread. Length: 1–200 characters.Example:
"Stripe Integration Task"You must provide either
action: "cancel" or a title. Providing both is allowed — the cancel takes precedence.Response Fields
Whether the operation succeeded.
The current status of the run after the operation.
Human-readable description of the result.
Use Cases
Cancel with Timeout Guard
Cancel Multiple Tasks
Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | Operation completed successfully |
| 400 | Bad Request | Invalid JSON or no valid action provided |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Task belongs to a different user |
| 404 | Not Found | Task not found |
| 500 | Internal Server Error | Server error |