Skip to main content
POST
/
v1
/
webhooks
Create webhook
curl --request POST \
  --url https://api.messages.dev/v1/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from": "+15551234567",
  "url": "https://example.com/webhooks",
  "events": [
    "message.received",
    "message.sent"
  ]
}
'
{
  "id": "<string>",
  "line_ids": [
    "<string>"
  ],
  "url": "<string>",
  "events": [
    "<string>"
  ],
  "secret": "<string>",
  "is_active": true,
  "request_id": "<string>"
}

Authorizations

Authorization
string
header
required

Use an API key as a bearer token: Authorization: Bearer sk_live_...

Body

application/json
from
string
required

Line handle (phone number or Apple ID) to subscribe to

Example:

"+15551234567"

url
string<uri>
required

HTTPS URL to receive webhook deliveries

Example:

"https://example.com/webhooks"

events
enum<string>[]
required

Events to subscribe to

Available options:
message.received,
message.sent,
reaction.added,
reaction.removed,
typing.started,
typing.stopped,
receipt.read
Example:
["message.received", "message.sent"]

Response

Webhook created

id
string

Webhook ID (e.g. wh_abc123)

line_ids
string[]

Line IDs this webhook is subscribed to (e.g. ["ln_abc123"])

url
string<uri>
events
string[]
secret
string

HMAC secret for verifying webhook signatures

is_active
boolean
request_id
string