curl --location 'https://api.weya.live/backend/api/whatsapp/whatsapp-integration' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"provider": "AI_SENSY",
"plan": "basic",
"phoneNumber": "+15551234567",
"token": "YOUR_AISENSY_API_TOKEN"
}'
{
"status": true,
"code": 201,
"message": "WhatsApp integration created successfully",
"errorMessage": null,
"data": {
"_id": "6891f1d0c45d123456789abc",
"phoneNumber": "+15551234567",
"provider": "AI_SENSY",
"plan": "basic",
"token": "YOUR_AISENSY_API_TOKEN",
"userId": "64e5f12345abcdef12345678",
"whatsappAgentId": null,
"createdAt": "2026-07-21T09:15:30.000Z"
}
}
WhatsApp
Create WhatsApp Integration
Connect a WhatsApp Business number from your AiSensy account.
POST
/
api
/
whatsapp
/
whatsapp-integration
curl --location 'https://api.weya.live/backend/api/whatsapp/whatsapp-integration' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"provider": "AI_SENSY",
"plan": "basic",
"phoneNumber": "+15551234567",
"token": "YOUR_AISENSY_API_TOKEN"
}'
{
"status": true,
"code": 201,
"message": "WhatsApp integration created successfully",
"errorMessage": null,
"data": {
"_id": "6891f1d0c45d123456789abc",
"phoneNumber": "+15551234567",
"provider": "AI_SENSY",
"plan": "basic",
"token": "YOUR_AISENSY_API_TOKEN",
"userId": "64e5f12345abcdef12345678",
"whatsappAgentId": null,
"createdAt": "2026-07-21T09:15:30.000Z"
}
}
Overview
Connect a WhatsApp Business number to Weya, for the user who owns the API key. WhatsApp numbers are connected through AiSensy, using your AiSensy API token. There are two plans:basic(default) – the number and token are saved as sent. Check them first with Validate WhatsApp Number.pro– also needs your AiSensyprojectId. The credentials are checked with AiSensy and Weya subscribes to the project’s message events before the number is saved.
_id is the ID that the other WhatsApp endpoints call phoneNumberId.
Prerequisites
- An API key for your workspace
- An AiSensy account with the WhatsApp number connected, and its API token
Request
curl --location 'https://api.weya.live/backend/api/whatsapp/whatsapp-integration' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"provider": "AI_SENSY",
"plan": "basic",
"phoneNumber": "+15551234567",
"token": "YOUR_AISENSY_API_TOKEN"
}'
Request Parameters
Response
{
"status": true,
"code": 201,
"message": "WhatsApp integration created successfully",
"errorMessage": null,
"data": {
"_id": "6891f1d0c45d123456789abc",
"phoneNumber": "+15551234567",
"provider": "AI_SENSY",
"plan": "basic",
"token": "YOUR_AISENSY_API_TOKEN",
"userId": "64e5f12345abcdef12345678",
"whatsappAgentId": null,
"createdAt": "2026-07-21T09:15:30.000Z"
}
}
Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request
providerisn’tAI_SENSY,phoneNumberortokenis missing, orprojectIdis missing forpro.WhatsApp integration already exists for this phone number.pro:WhatsApp integration already exists for this AiSensy project, or AiSensy rejected the credentials.
- 401 Unauthorized – Missing or invalid API key.
- 429 Too Many Requests – More than 1,000 WhatsApp requests in 15 minutes from your IP address.
- 500 Internal Server Error – Unexpected server error.
Typical workflow:
- Validate WhatsApp Number.
- Create the integration (this endpoint).
- Create WhatsApp Agent.
- Assign the agent to the number.
Was this page helpful?

