Skip to main content
POST
/
instances
/
{id}
/
webhooks
Create webhook
curl --request POST \
  --url https://api.zapfy.io/v1/instances/{id}/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://your-app.com/webhooks",
  "events": [
    "MESSAGE_RECEIVED",
    "MESSAGE_STATUS"
  ],
  "enabled": true
}
'
{
  "data": {
    "id": "01J9Z...",
    "url": "https://your-app.com/webhooks",
    "events": [],
    "enabled": true,
    "createdAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Account token (zpfy_acct_...) — manages instances and webhooks.

Path Parameters

id
string
required

Instance ID.

Body

application/json
url
string<uri>
required
Example:

"https://your-app.com/webhooks"

events
enum<string>[]
required
Minimum array length: 1
Available options:
MESSAGE_RECEIVED,
MESSAGE_SENT,
MESSAGE_STATUS,
CONNECTION_UPDATE,
QRCODE_UPDATED
Example:
["MESSAGE_RECEIVED", "MESSAGE_STATUS"]
enabled
boolean
default:true

Response

Webhook created.

data
object