RecoupGet a Free AuditFree Audit

API REFERENCE

Task Callback

On this page
POST/api/content-agent/callback

Internal callback endpoint for the poll-content-run Trigger.dev task. Receives content generation results and posts them back to the originating Slack thread. Authenticated via the x-callback-secret header.

This endpoint is not intended for external use — it is called automatically by the polling task when content runs complete, fail, or time out.

Authentication

callbackSecret

Request

cURL
curl --request POST \
  --url 'https://api.recoupable.dev/api/content-agent/callback' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "threadId": "string",
  "status": "completed"
}'

Request body required

Content generation results from the polling task

application/json

threadIdstringrequired

Chat SDK thread identifier for the originating Slack thread

statusstring · enumrequired

Overall status of the content generation batch

Values: "completed", "failed", "timeout"

resultsarray<object>

Per-run results

Item properties for results
runIdstringrequired

Trigger.dev run ID

statusstring · enumrequired

Values: "completed", "failed", "timeout"

videoUrlstring

URL of the generated video (when completed)

captionTextstring

Generated caption text (when completed)

errorstring

Error message (when failed)

messagestring

Optional human-readable message

Responses

200Callback processed and results posted to Slack

application/json

statusstring
400Invalid request body

No response body schema is specified.

401Missing or invalid callback secret

No response body schema is specified.

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download content.json
View operation source
json
{
  "description": "Internal callback endpoint for the `poll-content-run` Trigger.dev task. Receives content generation results and posts them back to the originating Slack thread. Authenticated via the `x-callback-secret` header.\n\nThis endpoint is not intended for external use — it is called automatically by the polling task when content runs complete, fail, or time out.",
  "requestBody": {
    "description": "Content generation results from the polling task",
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "threadId",
            "status"
          ],
          "properties": {
            "threadId": {
              "type": "string",
              "description": "Chat SDK thread identifier for the originating Slack thread"
            },
            "status": {
              "type": "string",
              "enum": [
                "completed",
                "failed",
                "timeout"
              ],
              "description": "Overall status of the content generation batch"
            },
            "results": {
              "type": "array",
              "description": "Per-run results",
              "items": {
                "type": "object",
                "required": [
                  "runId",
                  "status"
                ],
                "properties": {
                  "runId": {
                    "type": "string",
                    "description": "Trigger.dev run ID"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "completed",
                      "failed",
                      "timeout"
                    ]
                  },
                  "videoUrl": {
                    "type": "string",
                    "description": "URL of the generated video (when completed)"
                  },
                  "captionText": {
                    "type": "string",
                    "description": "Generated caption text (when completed)"
                  },
                  "error": {
                    "type": "string",
                    "description": "Error message (when failed)"
                  }
                }
              }
            },
            "message": {
              "type": "string",
              "description": "Optional human-readable message"
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Callback processed and results posted to Slack",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "example": "ok"
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "Invalid request body"
    },
    "401": {
      "description": "Missing or invalid callback secret"
    }
  },
  "security": [
    {
      "callbackSecret": []
    }
  ]
}