1. Webhooks
BeatAPI
  • Workflows
    • List launch workflows
      GET
  • Music Video
    • Create a Music Video workflow task
      POST
  • Ecommerce Video
    • Create an Ecommerce Video workflow task
      POST
  • Tasks
    • Poll task status
      GET
  • Usage
    • Get account usage and concurrency
      GET
  • Files
    • Upload a file for workflow inputs
      POST
  • Webhooks
    • List webhook endpoints
      GET
    • Create a webhook endpoint
      POST
    • Get a webhook endpoint
      GET
    • Update a webhook endpoint
      PATCH
    • Delete a webhook endpoint
      DELETE
  • Schemas
    • Workflow
    • TaskStatus
    • TaskUsage
    • Task
    • File
    • WebhookEndpoint
    • WebhookEvent
    • WorkflowList
    • WorkflowListResponse
    • TaskResponse
    • Usage
    • UsageResponse
    • FileResponse
    • WebhookEndpointList
    • WebhookEndpointListResponse
    • WebhookEndpointResponse
    • DeleteResponse
    • Error
  1. Webhooks

Create a webhook endpoint

POST
/v1/webhooks
The signing secret is returned only once at creation time. Store it
securely. Later responses return a masked secret.
BeatAPI sends these headers with each delivery:
x-beatapi-event: task.succeeded or task.failed
x-beatapi-timestamp: Unix timestamp in seconds
x-beatapi-signature: hex HMAC-SHA256 signature
Verify the signature by computing:
hmac_sha256(secret, timestamp + "." + raw_request_body).
Example delivery body:
{
  "id": "evt_123",
  "event": "task.succeeded",
  "created_at": 1782210300,
  "data": {
    "id": "task_8K2qA",
    "object": "task",
    "workflow": "music-video",
    "status": "succeeded",
    "output": {
      "media": [
        {
          "type": "video",
          "url": "https://media.beatapi.io/outputs/task_8K2qA/0.mp4",
          "mime_type": "video/mp4"
        }
      ]
    }
  }
}
Reject old timestamps to prevent replay attacks. A 5 minute window is
recommended. Failed deliveries are retried at most 3 times with fixed
backoff windows of 1 minute, 5 minutes, and 15 minutes. Polling
GET /v1/tasks/{task_id} remains the source of truth.

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Webhook endpoint created
Bodyapplication/json

🟠400BadRequest
🟠401Unauthorized
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.beatapi.io/v1/webhooks' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://example.com/beatapi-webhook",
    "events": [
        "task.succeeded",
        "task.failed"
    ]
}'
Response Response Example
201 - 成功示例
{
    "data": {
        "id": "wh_9aBcD",
        "object": "webhook_endpoint",
        "url": "https://example.com/beatapi-webhook",
        "description": "Production webhook",
        "events": [
            "task.succeeded",
            "task.failed"
        ],
        "status": "active",
        "secret": "whsec_example_store_this_once",
        "created_at": 1782210000,
        "updated_at": 1782210000
    }
}
Modified at 2026-06-25 13:50:22
Previous
List webhook endpoints
Next
Get a webhook endpoint
Built with