Skip to content

Send a Voice Message via API: One Request, One Ringing Phone

November 24, 2026 · 5 min read

You send a voice message with a single request, POST /v1/voice-messages: volai calls the number you give, reads your text word for word, hangs up, and you then find out how it went with a call lookup or a webhook. There is no agent on the line, nobody asks questions, and nothing is said beyond your text. It suits operational alerts and announcements, not unsolicited marketing.

What is a voice message and when should you use one?

It is an outbound call with one job: read a text. The recipient picks up and hears, for example, “Alert: server api-1 has not responded for five minutes.” It fits wherever email or SMS is not enough because nobody sees them in time: a server down at night, an alarm from a sensor, a shift reminder, a notice about a change in opening hours.

The text can be 1 to 500 characters and is read exactly as written, so nothing is paraphrased or improvised. If you need to talk to the person, use a call with a voice agent instead; a voice message is one-way.

Only with the recipient's consent

Automated marketing calls without prior consent are illegal. Send voice messages to people who want the alert, such as customers with an order or your own on-call team.

How do you send one with a single request?

You need an API key from the portal. The required fields are to (a number in international format) and text; the optional repeat sets how many times the text is read (an integer from 1 to 3, default 1, with a 1.5 second pause between readings).

bash
curl -X POST https://volai.cz/v1/voice-messages \
  -H "Authorization: Bearer vk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: incident-4711-1" \
  -d '{"to": "+420777123456", "text": "Alert: server api-1 has not responded for five minutes.", "repeat": 2, "language": "en"}'

The response comes back as soon as the call is placed and does not carry the result yet:

json
{
  "id": "c_k4m8p2q7r1s5",
  "status": "ringing",
  "from": "+420217217412",
  "language": "en"
}

status is ringing (sometimes initiated), from is the number the recipient sees on the display, and language is the language the text is read in. The Idempotency-Key header is honoured for 24 hours, the same as on POST /v1/calls: if you retry after a network error with the same key, the call is not placed a second time. A call is billed, so always send the key.

Do not send fields the API does not know. The schema is strict, so a field such as ringingTimeoutSecs ends in a validation error instead of being silently ignored.

How do you send one from Node.js?

The built-in fetch is enough; there is no library to install. Errors come back as error.code and error.message:

javascript
// Node.js 18+ ships fetch, so no package is needed.
const response = await fetch("https://volai.cz/v1/voice-messages", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.VOLAI_API_KEY,
    "Content-Type": "application/json",
    // The same key on a retry means the call is not placed twice.
    "Idempotency-Key": "incident-4711-1",
  },
  body: JSON.stringify({
    to: "+420777123456",
    text: "Alert: server api-1 has not responded for five minutes.",
    repeat: 2,
    language: "en",
  }),
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error("volai " + error.code + ": " + error.message);
}

const { id, status } = await response.json();
console.log(id, status); // c_k4m8p2q7r1s5 ringing

How do you handle errors and retries?

Under an Idempotency-Key the API stores every response for 24 hours, errors included. So reuse the same key only when no response arrived at all (a timeout, a dropped connection) and you do not know whether the first attempt went through: you get the stored response and the call is not placed a second time. If the first attempt is still in progress, the API returns 409 with idempotency_in_progress; wait a moment and retry with the same key. A different case is 409 with destination_busy: another call to the same number is still running (a second message to the same person within about 90 seconds of the first). Wait about a minute and send the request with a new key, because the same key would return the same error again. The error.code decides, not the 409 status alone.

Once an error response has arrived (validation, capacity_busy, rate_limited or a 503 voice_message_unavailable), the message was not sent, nothing was charged, and the same key would return the same error for 24 hours. After fixing the input, or after a short wait, in that case send the request with a new key, for example the event id in your monitoring plus an attempt number. Use a new key for a new message too, such as another outage of the same server. The exception is a 502 with engine_unavailable: the message may have gone out, so do not send it again right away; wait for the webhook or check your call list.

Store the returned id in your log. A later call lookup tells you whether the recipient heard the message, and the id makes the call easy to find if you ever need to ask support.

Which numbers can you call?

Without from, the message goes out from the shared volai number and reaches only Czech (+420) and Slovak (+421) numbers. The recipient sees the shared number, and a call back lands on the volai demo line. That is enough for alerts; for messages people should be able to answer, use your own number.

How do you call from your own number and in the recipient's language?

With from, the message leaves from your active calls and SMS number or from a number in another country. The recipient then sees your number, and a call back follows that number's routing. From your own number you can call Czechia and the country the number is in, once calling is switched on for it. A plain voice number is rejected with unsupported_for_number_type, and a number that is not on your account with from_number_not_owned.

The language field sets the language of the text, not the language of the recipient. volai reads the text with a voice in that language, so you have to write the text in it. Without from the default is Czech; with from it is the language of the country you are calling. It accepts the codes of the 23 voice agent languages (cs, sk, en, de, pl and more), and an unknown code returns invalid_language. A Polish message to a Polish number from a Polish number looks like this:

bash
curl -X POST https://volai.cz/v1/voice-messages \
  -H "Authorization: Bearer vk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: incident-4712-1" \
  -d '{"to": "+48601234567", "from": "+48221234567", "language": "pl", "text": "Alarm: serwer api-1 nie odpowiada od pięciu minut."}'

How do you know whether the message was heard?

The response to the send only says the phone is ringing. You can get the result in two ways. Either read the call with GET /v1/calls/{id}, where kind is voice_message and the voiceMessage block holds repeatPlayed (how many times the text was read) and completed (true when all readings finished and volai hung up, false when the recipient hung up earlier). If you add ?waitSecs=45 to the lookup, the server waits for the end of the call:

bash
curl https://volai.cz/v1/calls/c_k4m8p2q7r1s5 \
  -H "Authorization: Bearer vk_YOUR_KEY"

# Abridged output: the other call fields are left out.
# {
#   "call": {
#     "id": "c_k4m8p2q7r1s5",
#     "status": "completed",
#     "kind": "voice_message",
#     "voiceMessage": { "text": "...", "repeat": 2, "repeatPlayed": 2, "completed": true }
#   }
# }

Or have a webhook sent: call.completed when the call went through and call.no_answer when nobody picked up. It is worth subscribing to call.failed too (the call could not be placed); in that case send the message again with a new key. When placing the call fails you get the error response and the webhook at the same time, so react once, not to both. Setup is covered in the webhooks documentation. Do not send the message again just because the response says ringing; the call would be billed twice.

How much does it cost?

Only the outbound minute is billed, and an unanswered call costs nothing. From the shared number a minute is €0.0384 excluding VAT, billed per second. A message read into the recipient's voicemail counts as an answered call. When you send from your own number, a call to the number's own country is billed at that country's rate and a call to Czechia at the base outbound rate; a connected message is billed for at least 60 seconds (90 for some destinations). Current rates are on the pricing page.

What do you need first?

  • A verified email on the account. Without it the API returns email_unverified.
  • A first credit top-up. The welcome credit does not cover voice messages, which protects the shared number from abuse; without a top-up you get insufficient_credit.
  • A daily cap of 200 messages per account per 24 hours. Once it is used up the API returns rate_limited; write to support for a higher limit.

When volai cannot accept a voice message right now, it returns voice_message_unavailable (503), or voice_messages_disabled, and nothing is charged.

Can you do it without code?

Yes. The Calls page in the portal has a Send a voice message form that uses the same rules and limits as the API. AI assistants have the same function through the MCP server: the send_voice_message tool takes the same fields, see the MCP documentation. The full field reference, error codes and more examples are in the API documentation.

Try volai - first €2 on us

Sign up in a minute and your account already has starter credit for calls and a number - SMS work after your first top-up.

Try it for free