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>"
}

Documentation Index

Fetch the complete documentation index at: https://messages.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

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

Each key has a set of scopes that gate which endpoints it can call: messages:read, messages:write, chats:read, lines:read, reactions:read, reactions:write, typing:read, typing:write, receipts:read, receipts:write, webhooks:read, webhooks:write, outbox:read, files:read, files:write. Keys can also be restricted to a subset of lines.

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. See the schemas MessageReceivedEvent, MessageSentEvent, ReactionAddedEvent, ReactionRemovedEvent below for the data payload of each event.

Typing indicators (typing.started / typing.stopped) and inbound read receipts (receipt.read) are not delivered today; they will return when the underlying macOS-side detection layer surfaces them.

Available options:
message.received,
message.sent,
reaction.added,
reaction.removed
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