MessageOS
APIWebhooks

Register a webhook

POST
/webhooks

Registers a public https address and the event types it receives. The signing secret is returned once. Private and local addresses are rejected. An agent can have 10 webhooks that are not disabled, counting the ones added in the dashboard. Scope: webhooks:manage.

Authorization

bearer
headerAuthorizationBearer <mosc_...>

A client key (mosc_).

Request Body

application/json
  1. body
url*string
Length8 <= length <= 500
eventTypes*array<>
Items1 <= items <= 7

Response Body

The endpoint, with its signing secret.

application/json
  1. response
id*integer
url*string
eventTypes*array<>
status*string

paused after repeated dead deliveries. disabled after DELETE, a 410 response, or a PATCH to disabled. An endpoint removed with DELETE cannot be changed again.

Value in"active""paused""disabled"
secret*string

The signing secret. It is returned only once.

Example request

curl -X POST 'https://api.messageos.ai/v1/webhooks' \  -H 'Authorization: Bearer mosc_...' \  -H 'Content-Type: application/json' \  -d '{  "url": "https://example.com/messageos/webhooks",  "eventTypes": [    "message.delivered",    "reply.received",    "contact.opted_out"  ]}'

Example response

{  "id": 3,  "url": "https://example.com/messageos/webhooks",  "eventTypes": [    "message.delivered"  ],  "status": "active",  "secret": "9f1c2b7a4d3e8f60b5a1c9d2e7f4a3b6c8d1e2f3a4b5c6d7"}