The retry endpoint allows customers to automatically retry submitting posts where in their initial submission, one or more models failed to return results. Posts are retried only for the models which the task failed on. After retrying, any newly triggered rules are ran. New results from retried task submissions are not considered in aggregated results (i.e., user rules).
For more information on submitting a task, refer to the Task Request documentation (Sync or Async).
Sync Request
POST https://api.hivemoderation.com/api/v2/task/retry/syncA synchronous endpoint is preferred for users who have real-time needs, low latency requirements, and are submitting continuous / cyclical requests. The synchronous endpoint keeps the HTTP request open until results have finished processing and then sends the results directly in the response message.
Example Request
curl --request POST \
--url https://api.hivemoderation.com/api/v2/task/retry/sync \
--header 'authorization: token <API_KEY>' \
--header 'content-type: application/json' \
--data '{
"post_id": "post-123456",
"url": "https://mywebsite.com/new-signed-url?expiresIn=123456"
}'Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Yes | API key from Hive Moderation Dashboard (per-application). |
| Content-Type | String | Yes | Submit JSON data in the request body. |
Request Body Parameters
| Parameter (* required) | Type | Required | Description |
|---|---|---|---|
| post_id | String | Yes | ID tied to the post that was published (unique for each submission, no "_" or ";" in the ID). |
| url | String | No | Publicly accessible URL for sending images and videos. If not included, the original URL will be used. |
| text_data | String | No | Raw text data for task submission. If not included, the original text data will be used. |
| content_metadata | Object | No | Content metadata (can be different for each post). View this metadata on Moderation Dashboard when you click into a piece of content. If not included, the original content metadata will be used. |
| user_metadata / patron_metadata | Object | No | User metadata tied to each user ID on Moderation Dashboard (send with every API request). View this metadata on Moderation Dashboard when you open the User Detailed View. If not included, the original user metadata will be used. |
Sync Response
The retry endpoint response shares many similarities to the Sync Task Request endpoint response, almost as though it were the first submission for that post. It returns the task_ids for all models (even if the task succeeded the first time), the entire project_status_map, etc.
The distinction between these two responses is in the retry response’s project_status_map. There will be a boolean present, retried, whose value will be true if that model was retried.
Example Responses
Example Success (200 OK)
{
"task_ids": [
"8b37e8d1-2fb1-11f1-bc58-ffcbeeed39a2",
"8b379ab1-2fb1-11f1-ab76-8d376e934c14"
],
"post_id": "post-123456",
"user_id": "user-123456",
"group_id": "group-123456",
"project_status_map": {
"12345": {
"moderation_type": "visual",
"task_id": "8b37e8d1-2fb1-11f1-bc58-ffcbeeed39a2",
"status": "success",
"retried": true
},
"67890": {
"moderation_type": "ocr",
"task_id": "8b379ab1-2fb1-11f1-ab76-8d376e934c14",
"status": "success"
}
},
"url": "https://my-test-image.url",
"content_id": "2hOv4qOOw63yEN4VnWRsXr_2026-04-03T23:05:01.486Z_2bM21a29PFBc9vB5xxKoHL",
"triggered_rules": [
{
"rule_id": "6QAg1Vemg0nHjd2e8wMW4M",
"rule_name": "Rule Test Mode",
"action_id": "send_post_to_review"
},
{
"rule_id": "4P2lHViNAZdeQa9CIRnZQB",
"rule_name": "If post contains Violence, Sexual, then remove post",
"action_id": "4OVAJyKBUsnmJAO5sMc0VA"
}
],
"triggered_background_rules": []
}Example Error Response (400 Bad Request)
{
"error": true,
"status": 400,
"error_code": "POST_MODERATION_ALREADY_SUCCEEDED",
"message": "Post with id post-123456 has already successfully been moderated."
}Async Request
POST https://api.hivemoderation.com/api/v2/task/retry/asyncThe asynchronous endpoint is preferred for users who are submitting their volume in large batches, or users submitting tasks containing large files (i.e. longer videos or audio clips). The asynchronous endpoint immediately sends a response acknowledging receipt of the task, along with a unique task_id. It then closes the connection. Once the task is completed, Hive will send a POST request to the provided callback_url containing the completed task's results.
Example Request
curl --request POST \
--url https://api.hivemoderation.com/api/v2/task/retry/async \
--header 'authorization: token <API_KEY>' \
--header 'content-type: application/json' \
--data '{
"url": "https://mywebsite.com/new-signed-url?expiresIn=123456",
"callback_url": "https://mywebsite.com/retry-callback-endpoint",
"post_id": "post-123456"
}'Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Yes | API key from Hive Moderation Dashboard (per-application). |
| Content-Type | String | Yes | Submit JSON data in the request body. |
Request Body Parameters
The parameters for the async endpoint has all the parameters in the sync endpoint, plus the following:
| Parameter | Type | Required | Description |
|---|---|---|---|
| callback_url | String | No | URL to receive callback when task completes. If not included, the original callback URL will be used. |
Async Response
The retry endpoint response shares many similarities to the Async Task Request endpoint response, almost as though it were the first submission for that post. It returns the task_ids for all models (even if the task succeeded the first time), the entire project_status_map, etc.
The distinction is in the callback only, where project_status_map will have a boolean present, retried, whose value will be true if that model was retried.
Example Responses
Example Success (200 OK)
{
"task_ids": [
"ccb639c1-2fb0-11f1-aebe-2f17edb80305"
],
"post_id": "post-123456",
"user_id": "user-123456",
"conversation_id": "conv-123456",
"project_status_map": {
"12345": {
"moderation_type": "text",
"task_id": "ccb639c1-2fb0-11f1-aebe-2f17edb80305",
"status": "pending"
}
},
"message": "We received your submission."
}Example Error Response (400 Bad Request)
{
"error": true,
"status": 400,
"error_code": "INVALID_POST",
"message": "This post post-123456 does not exist"
}Common Errors
| Status Code | Error Code | Description |
|---|---|---|
| 400 | INVALID_POST | Invalid post_id, the post does not exist. |
| 400 | INVALID_POST_TYPE | Post type (i.e. conversation) is not supported for retry (must use a post within the conversation). |
| 400 | POST_MODERATION_ALREADY_SUCCEEDED | All models succeeded; retry unavailable. |
| 400 | POST_TOO_OLD_FOR_RETRY | Post was submitted more than 2 weeks ago. |
| 400 | VLM_NOT_SUPPORTED_FOR_ASYNC_TASKS | VLM tasks not supported for async. |
| 500 | POST_STILL_PROCESSING | Post is still pending moderation. |
