Force Retry Dispatch
Retry the dispatch of an activity in FAILED status. Administrative action that bypasses the state machine and resets the activity to READY for an immediate dispatch.
PATCH /api/activities/:id/force-retry-dispatch
Retries the dispatch of an activity in FAILED status. This is an administrative action that bypasses the state machine (the FAILED → READY transition is not valid under the regular transitions) and is used when automatic retries have run out and an operator with the right permission needs to force a new attempt.
Auth: Required — activity:force-retry-dispatch permission
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | Activity ID |
Example
curl -X PATCH https://api.reten.ai/api/activities/ee0e8400-e29b-41d4-a716-446655440000/force-retry-dispatch \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "x-project-id: <project-id>"import axios from 'axios';
const response = await axios.patch(
'https://api.reten.ai/api/activities/ee0e8400-e29b-41d4-a716-446655440000/force-retry-dispatch',
{},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
'x-project-id': '<project-id>',
},
}
);
const { status } = response.data;
// status will be "READY" after the reset; the immediate dispatch may move it to DISPATCHED, RETRYING or FAILED againResponse 200 OK
{
"status": "READY"
}Behaviour
- Resets the activity status to
READYand clears the error fields (dispatchAttemptCount,errorCode,errorMessage,rawPayload). - Records a
FORCE_RETRYstatus event associated with the user performing the action. - Attempts the dispatch immediately. If the immediate dispatch fails, the retry cron will pick the activity up on its next cycle (the request does not fail, it only logs a warning).
- Bypasses the state machine: the
FAILED → READYtransition is not valid under the regular state machine; this endpoint forces it intentionally as an administrative action.
Error Responses
| Status | Description |
|---|---|
400 | The activity has no dispatchConfigId (it does not use an external provider). |
404 | Activity not found. |
409 | The activity was already retried or changed status (it is not in FAILED). |