This webhook will receive all incoming messages, including those created using the A1Base API. To prevent infinite loops, you may want to check the sender_number to avoid agents replying to themselves.
Webhook Payload
Unique identifier for the chat thread
Unique identifier for the specific message
Type of chat - can be “group”, “individual”, or “broadcast”
Phone number of the message sender with country code. e.g. “+61400123456”
Name of the message sender
Your A1Base account identifier
Your A1Base account identifier
The A1Base phone number that received the message. e.g. “+61400999888”
When the message was handled on WhatsApp, in ISO 8601 format. e.g. “2024-12-20T00:48:15+00:00”
The messaging service used (e.g. “whatsapp”)
Type of the message. Can be one of: “text”, “rich_text”, “image”, “video”, “audio”, “reaction”, “group_invite”, “location”, “unsupported_message_type”
Whether the message was sent by an agent
The complete message content object containing all message data. Structure varies by message_type:For message_type: “text” (simple text)For message_type: “rich_text” (rich text with optional quote)For message_type: “image”For message_type: “video”For message_type: “audio”For message_type: “reaction”For message_type: “group_invite”For message_type: “location”For message_type: “unsupported_message_type”
HMAC-SHA256 signature used to verify the authenticity of the webhook. Created using your API secret and the timestamp + request body.
Unix timestamp (in seconds) when the webhook was sent. Used to verify the request and prevent replay attacks.
Response Codes
200: Message received successfully403: Invalid secret key500: Internal server error
Setting up your webhook
Setting up your webhook
- Create an endpoint in your application to receive webhook events:
- Deploy your endpoint to a public URL (e.g. using ngrok for testing)
- Update your webhook URL on the A1Base dashboard at https://www.a1base.com/dashboard/phone-numbers
Security best practices
Security best practices
- Validate the webhook payload structure matches the expected format
- Check the sender_number to avoid infinite loops with your own agent
- Use HTTPS endpoints only
- Keep your webhook URL private
- Implement rate limiting if needed
- Add error handling for failed message processing
-
All webhook requests from A1Base include an
x-signatureandx-timestampheader. - You can verify the authenticity of each request using your API secret and the HMAC-SHA256 algorithm.
-
Here’s how the signature is generated on our side:
- Read the raw JSON body of the request
- Get the x-timestamp header
- Recreate the message string as timestamp + rawBody
- Generate your own HMAC signature with your API secret
- Compare it with the x-signature using a constant-time comparison
Reject any webhook requests with a timestamp older than 5 minutes to prevent replay attacks.
Body
application/json
Unique identifier for the chat thread
Unique identifier for the specific message
Type of chat
Available options:
group, individual, broadcast The message content/text
Phone number of the message sender
Name of the message sender
Your A1Base account identifier
A timestamp in ISO 8601 format
The messaging service
Available options:
whatsapp, telegram Type of message content
Available options:
text, image, video, audio, document Whether the message is from an agent
Structured message content
Response
Message received successfully

