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 Activity is fully resolved and ready to act on. If the client has a provider configured to dispatch activities, the system's next action attempts the dispatch; otherwise the activity stays READY and an operator can act on it from the internal platform. status (see Activity States for the full state machine).
Auth: Required — activity:dispatch permission
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | Activity 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 successimport 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 successResponse 204 No Content
No response body. The activity status transitions to Activity was delivered to the external provider. This applies only when the client has a dispatch provider configured for the activity; clients that operate exclusively from Reten's internal platform never pass through this state. Having a dispatch provider does not prevent the result from being recorded internally: the outcome can arrive either from the external provider or from the internal platform. on success.
Error Responses
| Status | Description |
|---|---|
400 | Activity is not in READY status or is not a TASK type |
404 | Activity not found |
404 | No 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 Activity reached a failed terminal state through one of two paths: (a) dispatch attempts ran out without success; or (b) an end-of-day closing process detected an activity left retrying and marked it FAILED with result NOT_EXECUTED. Although terminal, a FAILED activity can be recovered manually via a dedicated endpoint that retries it once; the attempt can end in DISPATCHED, RETRYING, or FAILED again.
- Credentials are decrypted only during dispatch execution