Reten Docs

Dispatch Task Activity

Manually dispatch a TASK activity to an external provider.

POST /api/activities/tasks/:id/dispatch

Manually dispatch a TASK activity to an external provider. The activity must be in status (see Activity States for the full state machine).

Auth: Required — activity:dispatch permission

Path Parameters

ParameterTypeDescription
idUUIDActivity ID

Example

curl -X POST https://api.reten.ai/api/activities/tasks/ee0e8400-e29b-41d4-a716-446655440000/dispatch \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>" \
  -H "x-project-id: <project-id>"
const taskId = "ee0e8400-e29b-41d4-a716-446655440000";
const response = await fetch(`https://api.reten.ai/api/activities/tasks/${taskId}/dispatch`, {
  method: "POST",
  headers: {
    "Authorization": "Bearer <token>",
    "x-tenant-id": "<tenant-id>",
    "x-project-id": "<project-id>",
  },
});
// 204 No Content on success
import requests

task_id = "ee0e8400-e29b-41d4-a716-446655440000"
response = requests.post(
    f"https://api.reten.ai/api/activities/tasks/{task_id}/dispatch",
    headers={
        "Authorization": "Bearer <token>",
        "x-tenant-id": "<tenant-id>",
        "x-project-id": "<project-id>",
    },
)
# 204 No Content on success

Response 204 No Content

No response body. The activity status transitions to on success.

Error Responses

StatusDescription
400Activity is not in READY status or is not a TASK type
404Activity not found
404No dispatch config found for the activity's channel

Notes

  • Uses optimistic locking to prevent concurrent dispatch
  • On failure, retries up to 3 times before marking as
  • Credentials are decrypted only during dispatch execution