Create a Webhook

Create a new webhook to receive real-time event notifications.

POST https://api.platica.mx/v1/webhooks

Request body

{
  "name": "Webhook de Notificaciones",
  "url": "https://mi-app.com/webhook",
  "events": [
    "conversation.created",
    "conversation.status.updated",
    "message.created",
    "client.created",
    "client.customFields.updated"
  ],
  "active": true,
  "secret": "mi_secreto_seguro",
  "headers": {
    "Authorization": "Bearer token123",
    "Custom-Header": "valor personalizado"
  }
}

Body parameters

ParameterTypeDescriptionRequired
namestringDescriptive webhook name (max 100 characters)
urlstringURL where notifications are sent (max 500 characters)
eventsarrayList of events to subscribe to — see available events
activebooleanWebhook state
secretstringSecret used to validate authenticity (max 255 characters)
headersobjectCustom headers to include in the requests (max 10)

Response

{
  "status": "success",
  "message": "Webhook creado exitosamente",
  "data": {
    "id": "webhook_abc123",
    "workspaceId": "ws_456"
  }
}