# Cancel Fax

`POST /fax/{id}/cancel`

Cancel an outbound fax before transmission starts.

Cancellation stops queued preparation and every unsent part, releases the credit reservation, and changes the status to `CANCELLED`. Repeating a successful cancellation returns the same fax.

Cancellation is unavailable for inbound faxes, completed faxes, and `SUBMISSION_UNKNOWN` faxes. Pinnacle returns 409 once transmission may have started, even when later parts remain unsent.

**HIPAA only:** this endpoint exists only in Pinnacle's HIPAA cell and is unavailable at `https://api.pinnacle.sh`.

Only a fax ID owned by your team is accepted. Unknown IDs return 404.

## Authentication

Send your API key in the `PINNACLE-API-KEY` header.

## Parameters

- `id` — path, string, format: uuid. Fax ID returned by send, list, or a fax webhook.

## Responses

### 200

Fax cancelled before transmission started.

Content type: `application/json`. Schema: `Fax`.

- `id` — `string`, format: uuid
- `direction` — `FaxDirectionEnum`, values: `INBOUND`, `OUTBOUND`. `OUTBOUND` for faxes sent by your team or `INBOUND` for faxes received by your team.
- `from` — `string`. Sender number in E.164 format.
- `to` — `string`. Recipient number in E.164 format.
- `status` — `FaxStatusEnum`, values: `PREPARING`, `SUBMITTING`, `SUBMISSION_UNKNOWN`, `QUEUED`, `PROCESSING`, `SENDING`, `RECEIVING`, `DELIVERED`, `RECEIVED`, `FAILED`, `CANCELLED`. Current state of the fax:

- `PREPARING`: Pinnacle is downloading, validating, converting, splitting, or archiving the document.
- `SUBMITTING`: The fax is waiting for transmission to start.
- `SUBMISSION_UNKNOWN`: Transmission may have started, but Pinnacle cannot confirm it. The fax is not retried automatically.
- `QUEUED`: The outbound fax is queued for transmission.
- `PROCESSING`: The outbound document is being processed.
- `SENDING`: The outbound fax is being transmitted.
- `RECEIVING`: An inbound fax is in progress.
- `DELIVERED`: Every outbound part was delivered.
- `RECEIVED`: The inbound fax was received and archived.
- `FAILED`: Preparation, submission, or delivery failed. `partialContent` indicates whether any pages were transmitted.
- `CANCELLED`: The outbound fax was cancelled before transmission started.
- `pages` — `integer`, minimum: 0. Transmitted page count across the fax. This can be zero before transmission and can include only transmitted pages after a partial failure. Outbound documents can contain at most 3,500 pages.
- `durationSeconds` — `number`, minimum: 0. Total transmission duration in seconds.
- `partialContent` — `boolean`. Whether only part of the document was delivered, including when an earlier part succeeded before a later part failed.
- `failureReason` — `FaxFailureReasonEnum`, values: `MEDIA_PREPARATION_FAILED`, `MEDIA_PREPARATION_INTERRUPTED`, `INSUFFICIENT_CREDITS`, `SUBMISSION_UNCONFIRMED`, `SUBMISSION_REJECTED`, `DELIVERY_FAILED`. Stable failure category, or null when no failure is recorded:

- `MEDIA_PREPARATION_FAILED`: The source was unavailable, invalid, unsupported, over a limit, or could not be rendered.
- `MEDIA_PREPARATION_INTERRUPTED`: Preparation could not be completed after retries.
- `INSUFFICIENT_CREDITS`: The team's available credits could not cover the prepared page count.
- `SUBMISSION_UNCONFIRMED`: Transmission may have started, so Pinnacle will not retry automatically.
- `SUBMISSION_REJECTED`: Transmission could not start.
- `DELIVERY_FAILED`: Delivery failed or a transmitted part did not match the expected page count.
- `cost` — `number`, format: double; minimum: 0. Settled fax cost in USD, calculated at $0.025 per final transmitted page. Quality does not change the rate.
- `reservedCost` — `number`, format: double; minimum: 0. Credit reserved after document preparation for an unsettled outbound fax, in USD. This equals $0.025 multiplied by the prepared page count, regardless of quality, and is zero while status is `PREPARING`.
- `billingStatus` — `FaxBillingStatusEnum`. `PENDING` while a reservation or uncertain submission remains open; `SETTLED` after final charging, refund, or cancellation.
- `hasMedia` — `boolean`. Whether Pinnacle has archived the fax document.
- `createdAt` — `string`, format: date-time
- `updatedAt` — `string`, format: date-time

### 400

The request was unacceptable, often due to providing an invalid update.

Errors may originate from invalid payload or from Pinnacle's additional validation checks. For example, providing an URL that cannot be accessed, updating a campaign that is currently being reviewed, updating data that you cannot access, sending a malformed message, and so on.

For `Pinnacle Validation Error` inspect the `error` payload to determine the source of the failure. These errors are likely due to additional validation and business logic checks.

For `Request Validation Error` inspect the `description` and `errors` payload to determine the source of failure. These errors are likely due to invalid payload inside the request.

Content type: `application/json`. Schema: `Request Validation Error | Pinnacle Validation Error`.

- Variant: variant 1
- `description` — `string`. Human-readable summary of validation failures.
- `errors` — `object`. Structured dictionary of issues containing two main sections:
- `errors`: Array of global validation errors not tied to specific fields
- `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array
- Variant: variant 2
- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "description": "✖ Invalid input: expected string, received number\n  → at example_field",
  "errors": {
    "errors": [],
    "properties": {
      "example_field": {
        "errors": [
          "Invalid input: expected string, received NaN"
        ]
      }
    }
  }
}
```

### 401

The request lacks valid authentication credentials or the provided credentials are invalid.

Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "Invalid API key."
}
```

### 403

Your subscription does not include access to this feature.

This occurs when attempting to use functionality that requires a higher subscription tier.
Please upgrade your subscription to access this feature.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "Your subscription does not include access to this feature."
}
```

### 404

The requested resource could not be found.

This may occur if the identifier is incorrect, the resource has been deleted, or you don't have permission to access it.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "The requested resource could not be found."
}
```

### 409

This action cannot be completed right now because the resource is already being processed or is in a state that does not allow the requested change. Check the latest resource status and try again when it is ready.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "This resource is not ready for that action yet."
}
```

### 500

An unexpected error occurred on Pinnacle's servers while processing your request.

If this error persists, please contact support with the request details.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "An unexpected error occurred while processing your request."
}
```

### 503

Fax support is disabled or temporarily unavailable in this deployment.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "Fax support is disabled."
}
```

## SDK examples

### TypeScript

```typescript
import { PinnacleClient } from "rcs-js";

const client = new PinnacleClient({
  apiKey: process.env.PINNACLE_API_KEY!,
  baseUrl: process.env.PINNACLE_HIPAA_API_URL!,
});

await client.faxes.cancel("id");
```

### Python

```python
import os
from rcs import Pinnacle

client = Pinnacle(
    api_key=os.environ["PINNACLE_API_KEY"],
    base_url=os.environ["PINNACLE_HIPAA_API_URL"],
)

client.faxes.cancel(
    id="id",
)
```

### Ruby

```ruby
require "rcs"

client = Pinnacle::Client.new(
  api_key: ENV.fetch("PINNACLE_API_KEY"),
  base_url: ENV.fetch("PINNACLE_HIPAA_API_URL")
)

client.faxes.cancel(id: "id")
```

## Machine-readable schema

[OpenAPI 3.1 JSON](https://docs.pinnacle.sh/openapi.json)
