AeternityChat Developer API
Welcome to the AeternityChat Developer API.
Use these APIs to send messages, schedule customer sequences etc programmatically.
Authentication
All Developer API requests must include your API key in the request headers.
Required Header
{
"x-aeternitychat-key": "<your_api_key>"
}Messaging API
Send Bulk Messages
Send up to 100 messages in a single asynchronous request.
Note
- Maximum 100 messages per API request.
- Requests are accepted immediately and processed asynchronously in the background.
Endpoint
POST https://api.aeternity.chat/api/v1/developer/message/channel/:channel/connection/:connectionIdPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Messaging channel (for example: whatsapp) |
connectionId | string | Yes | Channel connection identifier |
Request Body
{
"messages": [
{
"messaging_product": "whatsapp",
"to": "910000000000",
"type": "text",
"text": {
"body": "test"
}
}
]
}Response
HTTP Status: 202 Accepted
{
"messages": [
{
"id": "<unique_id>",
"status": "ready"
},
{
"id": "<unique_id>",
"status": "failed",
"error": "<error_reason>"
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
messages | array | Processing result for each submitted message |
messages[].id | string | Unique message identifier |
messages[].status | string | Processing status (ready or failed) |
messages[].error | string | Failure reason (only present when status is failed) |
cURL Example
curl --request POST \
--url "https://api.aeternity.chat/api/v1/developer/message/channel/CHANNEL/connection/CONNECTION_ID" \
--header "Content-Type: application/json" \
--header "x-aeternitychat-key: YOUR_API_KEY" \
--data '{
"messages": [
{
"messaging_product": "whatsapp",
"to": "910000000000",
"type": "text",
"text": {
"body": "Hello from AeternityChat"
}
}
]
}'Notes
- Requests are processed asynchronously.
- Each message is validated independently.
- A successful API response (
202 Accepted) only indicates that the request has been accepted for processing. - Individual message failures are returned inside the
messagesarray.
Sequence API
Schedule a Journey
Schedule a sequence for a contact.
Endpoint
POST https://api.aeternity.chat/api/v1/developer/journey/schedule/:sequenceId/contact/:contactIdParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
sequenceId | string | Yes | — | Sequence identifier |
contactId | string | Yes | — | Contact identifier |
cancelAllPreviousJourneys | boolean | No | true | Cancel all existing scheduled sequences for the contact before scheduling the new one |
shiftMessagesBySeconds | number | No | 0 | Shift the timing of every message in the sequence by the specified number of seconds |
Response
HTTP Status: 202 Accepted
{}cURL Example
curl --request POST \
"https://api.aeternity.chat/api/v1/developer/journey/schedule/<sequenceId>/contact/<contactId>" \
--header "x-aeternitychat-key: YOUR_API_KEY"Cancel a Scheduled Sequence
Cancel one or all scheduled sequences for a contact.
Endpoint
POST https://api.aeternity.chat/api/v1/developer/journey/cancel/contact/:contactIdParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
contactId | string | Yes | — | Contact identifier |
cancelledReason | string | Yes | — | Reason for cancelling the journey |
scheduledJourneyId | string | No | — | Cancel a specific scheduled journey |
Response
HTTP Status: 202 Accepted
{}cURL Example
curl --request POST \
"https://api.aeternity.chat/api/v1/developer/journey/cancel/contact/<contactId>" \
--header "x-aeternitychat-key: YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"scheduledJourneyId": "test",
"cancelledReason": "Contact is qualified"
}'Notes
- To cancel a specific scheduled sequence, provide
scheduledJourneyId.