POST /webhooks

Register a webhook to receive WhatsApp events

application/json

Body

  • url string Required
  • secret string

    Secret for HMAC signature verification

  • events array[string]

Responses

  • 201 application/json

    Webhook created successfully

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • id integer
      • url string
      • events array[string]
      • active boolean
      • created_at string
  • 400 application/json

    Bad request

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
POST /webhooks
curl \
 --request POST 'http://localhost:7001/webhooks' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"url":"https://your-server.com/webhook","secret":"string","events":["message.received","connection.connected"]}'
Request examples
{
  "url": "https://your-server.com/webhook",
  "secret": "string",
  "events": [
    "message.received",
    "connection.connected"
  ]
}
Response examples (201)
{
  "code": 201,
  "data": {
    "id": 1,
    "url": "https://your-server.com/webhook",
    "active": true,
    "events": [
      "message.received",
      "connection.connected"
    ],
    "created_at": "2025-12-17T10:30:00Z"
  },
  "status": true,
  "message": "Webhook created successfully"
}
Response examples (201)
{
  "status": true,
  "code": 200,
  "message": "Webhook retrieved successfully",
  "data": {
    "id": 1,
    "url": "https://your-server.com/webhook",
    "events": [
      "message.received",
      "connection.connected"
    ],
    "active": true,
    "created_at": "2025-01-01T00:00:00Z"
  }
}
Response examples (400)
{
  "code": 400,
  "error": "URL must be HTTPS",
  "status": false,
  "message": "Bad request"
}
Response examples (400)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}
Response examples (401)
{
  "code": 401,
  "error": "Invalid or expired JWT token",
  "status": false,
  "message": "Unauthorized"
}
Response examples (401)
{
  "status": false,
  "code": 401,
  "message": "Unauthorized",
  "error": "Invalid or missing authentication"
}
Response examples (500)
{
  "code": 500,
  "error": "Failed to create webhook",
  "status": false,
  "message": "Internal server error"
}
Response examples (500)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}