Create webhook

Create a new webhook endpoint for the authenticated organization

Server URLhttps://api.animationapi.com/v1
POST/webhooks
AuthorizationBearer <token>

API Key authentication using Bearer token. Generate an API key from your dashboard and include it in the Authorization header. Format: Authorization: Bearer your_api_key_here

In: header

urlstring

The URL to send webhook notifications to

Formaturi
eventsarray<string>

List of events to subscribe to: "video.started", "video.finished", "video.failed"

Items1 <= items
enabled?boolean

Whether the webhook is enabled

Defaulttrue

Response Body

curl -X POST "https://api.animationapi.com/v1/webhooks" \  -H "Content-Type: application/json" \  -d '{    "url": "https://api.myapp.com/webhooks/video-gen",    "events": [      "video.started",      "video.finished"    ]  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "secret": "string",
  "org_id": "550e8400-e29b-41d4-a716-446655440001",
  "url": "https://api.myapp.com/webhooks/video-gen",
  "events": [
    "video.started",
    "video.finished"
  ],
  "enabled": true,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "Invalid JSON in request body"
  }
}

{
  "error": {
    "code": "AUTHENTICATION_REQUIRED",
    "message": "API key required. Please provide your API key in the Authorization header as 'Bearer your_api_key'"
  }
}

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed",
    "details": [
      {
        "field": "fps",
        "code": "INVALID_VALUE",
        "message": "fps must be one of: 12, 24, 30",
        "value": 60
      }
    ]
  }
}

{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "API rate limit exceeded",
    "details": "You have exceeded the maximum number of requests per minute",
    "retry_after": 60,
    "limit": 100,
    "remaining": 0,
    "reset": 1640995200
  }
}

{
  "error": {
    "code": "INTERNAL_SERVER_ERROR",
    "message": "An unexpected error occurred",
    "details": "Please try again later or contact support if the problem persists"
  }
}

{
  "error": {
    "code": "MAINTENANCE_MODE",
    "message": "Service is currently under maintenance",
    "details": "Scheduled maintenance in progress. Please try again later.",
    "retry_after": 3600
  }
}