# Send verification codes by voice (/docs/recipes/voice-otp)

Some users can't receive SMS (landlines, poor coverage, accessibility). Read the code to them instead, with just `to` and `message`.

```js
export async function sendVoiceCode(phone, code) {
  const spaced = code.split("").join(" "); // "4829" → "4 8 2 9"
  const res = await fetch("https://api.callhuman.es/v1/calls", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.CALLHUMAN_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      to: phone,
      message: `Your verification code is ${spaced}. Again, ${spaced}.`,
    }),
  });
  if (!res.ok) throw new Error((await res.json()).error.message);
  return res.json(); // { id, status: "queued" }
}
```

<CallTranscript lines={[{"from":"callhuman","kind":"message","text":"Your verification code is 4 8 2 9. Again, 4 8 2 9."}]} />

## Why it fits codes [#why-it-fits-codes]

- **One attempt, no retries**: a code is never read after it expired.
- **No webhook needed**: your login flow just waits for the user to type the code.
- Voicemail is never left, so codes don't end up stored on an answering machine.

See [One-way messages](/docs/one-way-messages) for the details.