# Send a fax

`POST https://api.morevoice.ai/v1/faxes`

Sends a PDF (up to 10 MB and 50 pages) from one of your fax numbers, as multipart/form-data (a `file` part) or as JSON with the file base64. The fax is queued and sent over the number's own line; a busy or dropped line is tried again (up to 3 tries). Follow it with GET /v1/faxes/{id} or the `fax.sent` / `fax.failed` events. A number whose line can't carry fax right now answers 409 (`details.readiness`). Needs a live key.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `faxes_create`.

## Parameters

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |
| `Idempotency-Key` | `string` | no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |

## Request body

Required, `application/json` or `multipart/form-data`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `phone_number_id` | `string` | yes | The number of yours that sends it (fax must be turned on for it, on a line that carries fax). |
| `to` | `string` | yes | The destination fax number: an Israeli landline or national number (mobile and international numbers can't receive faxes here). |
| `file` | `object` | yes | The document. JSON requests send it base64; multipart/form-data requests send a `file` part. |
| `file.content_base64` | `string` | yes | The PDF, base64 (up to 10 MB and 50 pages). |
| `file.filename` | `string` | no | — |

Example:

```json
{
  "file": {
    "content_base64": "JVBERi0xLjQKJcfsj6IK",
    "filename": "referral.pdf"
  },
  "phone_number_id": "pn_7H2kLm9QxR4tYb",
  "to": "035550199"
}
```

## Responses

### 201 Created

Created: the fax, queued. Returns `Fax`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"fax"` | — |
| `id` | `string` | A fax ID (prefix `fax_`). |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `direction` | `"inbound" \| "outbound"` | `inbound`: received on one of your fax numbers. `outbound`: sent from one. |
| `status` | `"queued" \| "sending" \| "receiving" \| "received" \| "delivered" \| "failed" \| "cancelled"` | Received faxes: `receiving` → `received` \| `failed`. Sent faxes: `queued` → `sending` → `delivered` \| `failed` (a busy or dropped line is tried again, up to `max_attempts`); `queued` → `cancelled`. |
| `phone_number_id` | `string \| null` | Your number it was received on or sent from; null once that number was released. |
| `local_number` | `string` | Your number (E.164) at the time of the fax. |
| `remote_number` | `string` | The other party: the sender of a received fax, the destination of a sent one. |
| `remote_station_id` | `string \| null` | The station id (TSI / CSID) the far fax machine announced. |
| `pages` | `integer` | Pages received, or pages of the document sent. |
| `attempts` | `integer` | Sent faxes: tries made so far. |
| `max_attempts` | `integer` | Sent faxes: the most tries it gets. |
| `next_attempt_at` | `string \| null` | Sent faxes waiting (`queued`): when the next try starts. |
| `has_document` | `boolean` | The PDF can be downloaded (GET /v1/faxes/{id}/document). |
| `file_name` | `string` | Sent faxes: the uploaded file's name. |
| `size_bytes` | `integer` | Size of the PDF in bytes. |
| `error_code` | `"busy" \| "no_answer" \| "rejected" \| "not_a_fax" \| "line_failed" \| "transmission" \| "no_line" \| "converter_unavailable" \| … \| null` | Why the fax failed: `busy`, `no_answer`, `rejected` (the far machine refused it), `not_a_fax` (no fax machine answered), `line_failed`, `transmission`, `no_line` (the number has no line that carries fax), `converter_unavailable`, `flag_off`, `cancelled`, `timeout` or `number_gone`. |
| `call_id` | `string \| null` | When the fax arrived on a voice call (fax tone detection on a voice number): that call. |
| `created` | `string` | An ISO-8601 timestamp in UTC. |
| `completed_at` | `string \| null` | When it was received, delivered, failed or cancelled. |

Example:

```json
{
  "attempts": 1,
  "call_id": null,
  "completed_at": "2026-11-06T09:16:05.000Z",
  "created": "2026-11-06T09:14:22.000Z",
  "direction": "outbound",
  "error_code": null,
  "file_name": "referral.pdf",
  "has_document": true,
  "id": "fax_5kQp2mZr8YtVx1Lb3",
  "livemode": true,
  "local_number": "+97235550100",
  "max_attempts": 3,
  "next_attempt_at": null,
  "object": "fax",
  "pages": 3,
  "phone_number_id": "pn_7H2kLm9QxR4tYb",
  "remote_number": "+97235550199",
  "remote_station_id": "ACME CLINIC",
  "size_bytes": 184320,
  "status": "delivered"
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID (in the path or the body) exists in this organisation and mode. Returns `ErrorEnvelope`.

### 409 Conflict

The request conflicts with the object's state, or the Idempotency-Key was reused with other parameters. Returns `ErrorEnvelope`.

### 413 Payload Too Large

The request body is larger than the endpoint accepts, or has more parts or files than it takes. Returns `ErrorEnvelope`.

### 415 Unsupported Media Type

The request body's Content-Type is not one the endpoint takes. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

### 503 Service Unavailable

A dependency this endpoint needs (a speech or language model, file storage) is temporarily unavailable. Retry later. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const fax = await mv.faxes.create({
	file: {
		content_base64: "JVBERi0xLjQKJcfsj6IK",
		filename: "referral.pdf",
	},
	phone_number_id: "pn_7H2kLm9QxR4tYb",
	to: "035550199",
});
console.log(fax);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

fax = client.faxes.create({
    "file": {
        "content_base64": "JVBERi0xLjQKJcfsj6IK",
        "filename": "referral.pdf",
    },
    "phone_number_id": "pn_7H2kLm9QxR4tYb",
    "to": "035550199",
})
print(fax)
```

**cURL**

```sh
curl -X POST https://api.morevoice.ai/v1/faxes \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "file": {
    "content_base64": "JVBERi0xLjQKJcfsj6IK",
    "filename": "referral.pdf"
  },
  "phone_number_id": "pn_7H2kLm9QxR4tYb",
  "to": "035550199"
}'
```
