Create invitation
Create a partner invitation link for a client to connect a Meta channel. The client opens the returned url and authorizes with Meta; the resulting sender is created in your project when they finish, and the invitation transitions to completed.
connectionType picks the channel:
whatsapp_waba(default): Meta’s embedded signup links an official WhatsApp Business Account.messenger: the client picks a Facebook Page they administer; its Messenger inbox (including Marketplace chats) is routed to Zavu.
One invitation connects one channel — create one per channel to onboard a client on several. phoneNumberId and allowedPhoneCountries apply to whatsapp_waba only.
curl --request POST \
--url https://api.zavu.dev/v1/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientName": "Acme Corp"
}
'{
"invitation": {
"id": "inv_abc123",
"url": "https://dashboard.zavu.dev/invite/abc123xyz",
"token": "<string>",
"status": "pending",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"clientName": "<string>",
"clientEmail": "<string>",
"clientPhone": "<string>",
"phoneNumberId": "<string>",
"connectionType": "whatsapp_waba",
"senderId": "<string>",
"connectedAccount": {
"channel": "whatsapp",
"id": "<string>",
"name": "<string>"
},
"failureReason": "<string>",
"failedAt": "2023-11-07T05:31:56Z",
"viewedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Name of the client being invited.
100"Acme Corp"
Email of the client being invited.
"contact@acme.com"
Phone number of the client in E.164 format.
"+14155551234"
ID of a Zavu phone number to pre-assign for WhatsApp registration. If provided, the client will use this number instead of their own. Only valid when connectionType is whatsapp_waba — sending it with messenger returns 400, since a Facebook Page has no phone number.
"pn_abc123"
Number of days until the invitation expires.
1 <= x <= 30ISO country codes for allowed phone numbers. Only valid when connectionType is whatsapp_waba — sending it with messenger returns 400.
2["US", "MX"]
Which Meta channel the client connects, and how.
whatsapp_waba(default): Meta's embedded signup links an official WhatsApp Business Account. AcceptsphoneNumberIdandallowedPhoneCountries.messenger: the client authorizes with Facebook and picks a Facebook Page they administer. The Page's Messenger inbox — including Marketplace chats — is routed to Zavu. They must be an admin of at least one Page. A Page can only be connected to one Zavu project at a time: if the client picks a Page that another project already connected, the newer connection wins and the older one is disconnected.
One invitation connects one channel. To onboard a client on several channels, create one invitation per channel; each completes into its own sender.
whatsapp_waba, messenger Response
Invitation created.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.zavu.dev/v1/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientName": "Acme Corp"
}
'{
"invitation": {
"id": "inv_abc123",
"url": "https://dashboard.zavu.dev/invite/abc123xyz",
"token": "<string>",
"status": "pending",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"clientName": "<string>",
"clientEmail": "<string>",
"clientPhone": "<string>",
"phoneNumberId": "<string>",
"connectionType": "whatsapp_waba",
"senderId": "<string>",
"connectedAccount": {
"channel": "whatsapp",
"id": "<string>",
"name": "<string>"
},
"failureReason": "<string>",
"failedAt": "2023-11-07T05:31:56Z",
"viewedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}