Skip to content

Interrupt Task

POST/tasks/{task_id}/interrupt

Stop the in-flight turn without terminating the task. Transitions a running task to the non-terminal INTERRUPTED status; the task stays continuable and the next message or event resumes it.

Path ParametersExpand Collapse
task_id: string
Body ParametersJSONExpand Collapse
reason: optional string
ReturnsExpand Collapse
Task object { id, cleaned_at, created_at, 6 more }
id: string
cleaned_at: optional string
created_at: optional string
name: optional string
params: optional map[unknown]
status: optional "CANCELED" or "COMPLETED" or "FAILED" or 5 more
One of the following:
"CANCELED"
"COMPLETED"
"FAILED"
"RUNNING"
"INTERRUPTED"
"TERMINATED"
"TIMED_OUT"
"DELETED"
status_reason: optional string
task_metadata: optional map[unknown]
updated_at: optional string

Interrupt Task

curl http://localhost:5003/tasks/$TASK_ID/interrupt \
    -X POST \
    -H "Authorization: Bearer $AGENTEX_SDK_API_KEY"
{
  "id": "id",
  "cleaned_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "name": "name",
  "params": {
    "foo": "bar"
  },
  "status": "CANCELED",
  "status_reason": "status_reason",
  "task_metadata": {
    "foo": "bar"
  },
  "updated_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "id": "id",
  "cleaned_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "name": "name",
  "params": {
    "foo": "bar"
  },
  "status": "CANCELED",
  "status_reason": "status_reason",
  "task_metadata": {
    "foo": "bar"
  },
  "updated_at": "2019-12-27T18:11:19.117Z"
}