Authentication, scopes, rate limits, errors, retrying safely and paging are explained once, on the API reference.
Every request needs a token with the scope shown on its endpoint; without it the answer is 403.
Messages
Send an email
POST/api/v1/messages/emailScope messages:send
Send one plain-text email to one contact, through your email connection. A real message, billed per message.
An address that bounced or complained is never sent to, nor a contact on Do-Not-Call or who withdrew consent, and nothing goes in the quiet hours. It is written on the contact's timeline. Requires an Idempotency-Key header.
This sends a real message to a real customer, billed from your wallet for each one at your plan's price per message. Send an Idempotency-Key header: without one the request is refused (428) and nothing is sent.
Parameters
Parameter
Type
What it is
Idempotency-Keyrequired
string, up to 255 characters, in the headers
Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422. Required here: without it the request is refused with 428 and nothing is sent.
Request body (application/json)
Field
Type
What it is
contact_id
string (uuid), or null
The contact to send to. Send this or the address.
channel_id
string (uuid), or null
The connection to send through (Integrations). Left out, the workspace's active connection of this kind is used; with more than one, this is required.
email
string, up to 254 characters, or null
The address to send to when you do not send contact_id. It must be a contact's address.
subjectrequired
string, up to 200 characters
—
bodyrequired
string, up to 20000 characters
The message, as plain text.
Answer (200): these fields
Field
Type
What it is
channelrequired
string
whatsapp, sms or email.
statusrequired
string
sent, or queued when the channel takes it for later delivery. Delivery and reads arrive as webhooks.
contact_idrequired
string (uuid)
—
message_id
string, or null
The channel's id for the message, when it gives one.
fee_inrrequired
number
What this message cost from your wallet (0 when your plan includes it). The channel's own charge is billed by the channel.
Errors
Code
When
401
The token is missing, unknown or revoked, or its workspace was deleted.
402
The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The wallet cannot cover this message's fee, or the plan does not include this channel.
403
The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.
404
The contact or the connection was not found.
409
Not sent: Do-Not-Call, no consent, the customer turned off offers, the address is suppressed, quiet hours, or the connection is not active or not set up. detail says which.
422
A field is missing or not in the form this endpoint takes. detail says which, and why.
428
No Idempotency-Key header. Nothing was sent.
429
This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.
502
The channel did not take the message. Nothing was charged.
POST /api/v1/messages/email with curl
curl -X POST "https://aicallstudio.com/api/v1/messages/email" \
-H "Authorization: Bearer mtc_YOUR_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"contact_id":"YOUR_CONTACT_ID","subject":"Your receipt","body":"Thank you, we received your payment."}'
Send an SMS
POST/api/v1/messages/smsScope messages:send
Send the SMS connection's registered template to one person. A real message, billed per message.
Only the registered template goes (India's DLT rules), never free text. Do-Not-Call, consent and the quiet hours apply. It is written on the contact's timeline. Requires an Idempotency-Key header.
This sends a real message to a real customer, billed from your wallet for each one at your plan's price per message. Send an Idempotency-Key header: without one the request is refused (428) and nothing is sent.
Parameters
Parameter
Type
What it is
Idempotency-Keyrequired
string, up to 255 characters, in the headers
Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422. Required here: without it the request is refused with 428 and nothing is sent.
Request body (application/json)
Field
Type
What it is
contact_id
string (uuid), or null
The contact to send to. Send this or the address.
channel_id
string (uuid), or null
The connection to send through (Integrations). Left out, the workspace's active connection of this kind is used; with more than one, this is required.
phone
string, up to 20 characters, or null
The number to send to when you do not send contact_id. A new number is saved as a contact.
name
string, up to 255 characters, or null
The person's name, for a new number.
templaterequired
string, up to 200 characters
The SMS connection's registered template, by its name or id. Only that template is sent, never free text (India's DLT rules).
values
object
The template's variables by name.
Answer (200): these fields
Field
Type
What it is
channelrequired
string
whatsapp, sms or email.
statusrequired
string
sent, or queued when the channel takes it for later delivery. Delivery and reads arrive as webhooks.
contact_idrequired
string (uuid)
—
message_id
string, or null
The channel's id for the message, when it gives one.
fee_inrrequired
number
What this message cost from your wallet (0 when your plan includes it). The channel's own charge is billed by the channel.
Errors
Code
When
401
The token is missing, unknown or revoked, or its workspace was deleted.
402
The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The wallet cannot cover this message's fee, or the plan does not include this channel.
403
The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.
404
The contact or the connection was not found.
409
Not sent: Do-Not-Call, no consent, the customer turned off offers, the address is suppressed, quiet hours, or the connection is not active or not set up. detail says which.
422
A field is missing or not in the form this endpoint takes. detail says which, and why.
428
No Idempotency-Key header. Nothing was sent.
429
This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.
502
The channel did not take the message. Nothing was charged.
Send one approved WhatsApp template to one person. A real message, billed per message.
The same checks as the inbox: the template must be approved for the connection, a customer on Do-Not-Call or without consent is never messaged, one who turned off offers is not sent a marketing template, and nothing goes in the quiet hours. The message lands in the WhatsApp inbox and the contact's timeline (the inbox.message_sent webhook); delivered and read follow as the channel reports them. Requires an Idempotency-Key header.
This sends a real message to a real customer, billed from your wallet for each one at your plan's price per message. Send an Idempotency-Key header: without one the request is refused (428) and nothing is sent.
Parameters
Parameter
Type
What it is
Idempotency-Keyrequired
string, up to 255 characters, in the headers
Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422. Required here: without it the request is refused with 428 and nothing is sent.
Request body (application/json)
Field
Type
What it is
contact_id
string (uuid), or null
The contact to send to. Send this or the address.
channel_id
string (uuid), or null
The connection to send through (Integrations). Left out, the workspace's active connection of this kind is used; with more than one, this is required.
phone
string, up to 20 characters, or null
The number to send to when you do not send contact_id: 8 to 15 digits, optionally starting with +. A new number is saved as a contact (send name for it).
name
string, up to 255 characters, or null
The person's name, for a new number.
templaterequired
string, up to 200 characters
The name of a WhatsApp template approved for this connection. Only approved templates are sent; free text is not, because the 24-hour window may be closed.
values
object
The template's blanks by their number or name, such as {"1": "Asha", "2": "12,500"}. A blank left out is filled from the contact where it can be.
Answer (200): these fields
Field
Type
What it is
channelrequired
string
whatsapp, sms or email.
statusrequired
string
sent, or queued when the channel takes it for later delivery. Delivery and reads arrive as webhooks.
contact_idrequired
string (uuid)
—
message_id
string, or null
The channel's id for the message, when it gives one.
fee_inrrequired
number
What this message cost from your wallet (0 when your plan includes it). The channel's own charge is billed by the channel.
Errors
Code
When
401
The token is missing, unknown or revoked, or its workspace was deleted.
402
The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The wallet cannot cover this message's fee, or the plan does not include this channel.
403
The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.
404
The contact or the connection was not found.
409
Not sent: Do-Not-Call, no consent, the customer turned off offers, the address is suppressed, quiet hours, or the connection is not active or not set up. detail says which.
422
A field is missing or not in the form this endpoint takes. detail says which, and why.
428
No Idempotency-Key header. Nothing was sent.
429
This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.
502
The channel did not take the message. Nothing was charged.