{
  "openapi": "3.1.0",
  "info": {
    "title": "FaxDash API",
    "version": "v1",
    "description": "The FaxDash REST API sends faxes and reads your fax history, inbox, contacts, credits, numbers and audit log, and manages your webhook endpoints. It is the same API the FaxDash app and dashboard use.\n\nAPI keys work on the Business plan. Create one in the dashboard under Settings → Integrations → API Keys and send it in the `X-API-Key` header (or as `Authorization: Bearer fxk_…`). Each key has permissions; every operation below names the one it needs.\n\nSuccessful responses are JSON wrapped in `{ \"data\": … }`. Errors are `{ \"error\": \"<message>\" }`, often with a `code` and further fields.\n\nBusiness includes 10,000 API-key requests a month, counted per account and reset on the 1st (UTC); an Enterprise account has its own, higher allowance. Requests over the allowance keep working and are not charged; see your count and your allowance with `GET /v1/api-usage`. Need more, many numbers, or something built for your systems? Enterprise is quoted per customer: email sales@faxdash.io.\n\n## Retrying safely\n\nSending a fax, sending a batch and adding a contact accept an `Idempotency-Key` header: any value you choose, 1 to 255 printable ASCII characters, such as a UUID. Send the same key when you retry, and the request runs once: a retry within 24 hours gets the first response again, with the header `Idempotent-Replayed: true`, and nothing is sent or charged twice. A replayed send uses no send, so it carries no `X-RateLimit-*` headers. Use a new key for each new request. A key reused with a different body is refused with 422 (`code: idempotency_mismatch`). Whatever the first request answered is what a retry gets, a server error (5xx) included, because the fax may already have gone out; only a 429 is not kept, so retrying it with the same key runs the request. A retry while the first request is still running gets 409 (`code: idempotency_in_progress`): wait a moment and retry. If a key keeps answering 409, the first request ended without a stored result: check `GET /v1/fax` to see whether the fax went out, and only if it did not, send again with a new key.\n\n## Rate limits\n\nEach API key has its own limits, and the account the key belongs to has a ceiling shared by all of its keys and its dashboard and app sessions.\n\n- Reads (`GET`): 600 a minute per key, 3,000 a minute per account.\n- Writes (uploads, contacts, inbox changes): 120 a minute per key, 600 a minute per account.\n- Sends (`POST /v1/fax/send` and `/v1/fax/send-batch`): 60 a minute per key, 10 in 5 minutes per account.\n- Downloads (`GET /v1/inbox/{id}` and `GET /v1/documents/download-url`): 120 an hour per key.\n\nLimits refill continuously (a token bucket), so a key at 600 a minute gets one more read every 100 ms. Responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` (for whichever of the key and the account is closer to its limit) and `X-RateLimit-Reset` (seconds until it is full again). Over a limit the answer is `429` with `code: rate_limited` and a `Retry-After` header in seconds; wait that long before retrying. A send refused for any other reason does not use up a send, and neither does a replayed send (see Retrying safely), which is why its response has no `X-RateLimit-*` headers.\n\nConnecting an AI assistant? Use the MCP connector instead: see https://faxdash.io/help/integrations/.\n\n## Handling health information\n\nIf your integration moves protected health information:\n\n- Use one key per system, so revoking one does not stop the others and the audit log says which system did what.\n- Give each key only the permissions it needs. Only the system that needs a fax's pages should hold `inbox:content`.\n- Keep the key in a secrets manager, never in source code or a log, and set an expiry (rotate at least yearly).\n- Do not log request or response bodies: they can contain patient details.\n- Read the audit log (`GET /v1/audit`) regularly to see what each key did."
  },
  "servers": [
    {
      "url": "https://api.faxdash.io"
    }
  ],
  "security": [
    {
      "ApiKey": []
    },
    {
      "Bearer": []
    }
  ],
  "tags": [
    {
      "name": "Faxes"
    },
    {
      "name": "Documents"
    },
    {
      "name": "Inbox"
    },
    {
      "name": "Contacts"
    },
    {
      "name": "Credits"
    },
    {
      "name": "Numbers"
    },
    {
      "name": "Audit"
    },
    {
      "name": "Webhooks"
    }
  ],
  "paths": {
    "/v1/fax/send": {
      "post": {
        "operationId": "postFaxSend",
        "tags": [
          "Faxes"
        ],
        "summary": "Send a fax",
        "description": "Sends a document uploaded with `POST /v1/documents/upload-url` to one number, now or at `scheduledAt`. A key can send documents it uploaded itself (a rotated key keeps its predecessor's), or, with `documents:read`, any document uploaded to the account. Never a scan from the scan library.\n\nSending costs one credit per page to a +1 number and two per page anywhere else, charged when the send is accepted. The pages charged are the larger of `pageCount` and the pages in the PDF, plus one for a cover. A fax that fails for good is refunded. Follow it with `GET /v1/fax/{id}`, or have a webhook tell you.\n\nOnly one fax to a number can be in progress at a time, and up to 10 single sends are accepted per 5 minutes (a batch does not count towards it).\n\nRequires the `fax:send` permission.",
        "x-scope": "fax:send",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "description": "Makes a retry safe: the same key with the same body within 24 hours returns the first response (with `Idempotent-Replayed: true`) instead of running again. Any value you choose, such as a UUID; a new one per request."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "documentId",
                  "destinationNumber"
                ],
                "properties": {
                  "documentId": {
                    "type": "string",
                    "description": "The `id` from `POST /v1/documents/upload-url`."
                  },
                  "destinationNumber": {
                    "type": "string",
                    "description": "Where to send it. E.164 (`+` and the country code) is safest; 10 digits, or 11 starting with 1, are read as a +1 number.",
                    "examples": [
                      "+12025550142"
                    ]
                  },
                  "scheduledAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Send later, at this time: an ISO 8601 date-time with `Z` or an offset, at most one year ahead. Omit to send now. A time less than a minute away, or in the past, is sent now."
                  },
                  "pageCount": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 500,
                    "description": "Pages in the document. Defaults to the count given at upload."
                  },
                  "cover": {
                    "description": "Put a cover sheet in front, charged as one more page. Omitted or `false`: no cover, even if a default cover is set to go on every fax. `\"default\"` or `true`: the default cover chosen under Settings → Cover sheet. `{ \"fields\": { ... } }`: the default cover with these fields filled in. `{ \"sheet\": \"irs\", \"fields\": { ... } }`: a sheet from the cover sheet library, named by the last part of its address (irs for faxdash.io/fax-cover-sheets/irs); a field the sheet does not have is refused. Saved cover details fill whatever `fields` leaves out, and the page count is filled in for you.",
                    "oneOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "default"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "sheet": {
                            "type": "string",
                            "description": "A cover sheet library slug, such as `irs`."
                          },
                          "fields": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            },
                            "description": "Field values by key."
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "confirmUnreachable": {
                    "type": "boolean",
                    "description": "Send even though this number has repeatedly failed to accept a fax recently. Set only after the refusal below, if you mean it."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the stored response to an earlier request with the same `Idempotency-Key`. A replayed send carries no `X-RateLimit-*` headers: it uses no send.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id",
                        "status"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The fax id."
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "sending",
                            "scheduled"
                          ]
                        },
                        "scheduledAt": {
                          "type": "string",
                          "description": "On a scheduled send: when it is due, in UTC (ISO 8601)."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A required field is missing, the number is not a valid fax number, `scheduledAt` is not a date-time with a timezone or is more than a year ahead, `pageCount` is not 1 to 500, `cover` is malformed, or a fax to this number is already in progress (wait for it to finish). Or: `Idempotency-Key` is not 1 to 255 printable ASCII characters (`code: idempotency_key_invalid`). Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Not enough credits for the pages (`Insufficient credits`, which names the total for an international fax), free signup credits used for a destination they do not cover (`code: purchase_required`), or a team member's monthly page limit reached (`code: member_cap_reached`, with `used`, `monthlyQuota` and `resetsOn`). Nothing is charged. Or: The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key may not send this document (`code: document_not_from_key`), the destination is in a country FaxDash cannot fax (`code: destination_sanctioned`), sending is blocked on this account, or the caller's team role cannot send (`code: team_role`). Also the shared missing-permission refusal. Or: The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`Document not found` (`code: document_not_found`): no document with this `documentId` on the account, for example one that was deleted or expired; upload it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "This number has not accepted a fax on recent attempts (`code: destination_unreachable`, `overridable: true`): check it, or send again with `confirmUnreachable: true`. Or every number on the account is connected to a fax machine (`code: sender_on_fax_machine`). Or `cover` asks for the default cover but none is chosen (`code: no_default_cover`). Or: A request with this `Idempotency-Key` is still running, or ended without a stored result (`code: idempotency_in_progress`). Retry shortly; if it persists, check `GET /v1/fax` before sending again under a new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "The upload expired before it was sent (`code: document_expired`). Uploads that are never sent are deleted after 24 hours; upload it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A cover cannot be added to this document (`code: cover_unsupported`). Send it without a cover. Or: This `Idempotency-Key` was already used with a different request (`code: idempotency_mismatch`). Use a new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "More than 10 sends in 5 minutes on the account, or 60 a minute on the key. Counts sends, not pages. Or: Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The carrier did not take the fax; the charge was refunded. `code` says why: `carrier_refused` (`The carrier refused this fax. Nothing was charged. Check the number, then try again.`), `destination_not_supported` (FaxDash cannot send to that country at the moment; nothing is wrong with the number), or `carrier_error` (the carrier answered with a problem on its or FaxDash's side; try again shortly).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The send could not be charged, the plan or purchase history could not be checked, or the document could not be read. Nothing was charged; retry shortly. Or the fax network is busy (`code: carrier_busy`): the charge was refunded; try again in a few minutes. Or: The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/fax/send-batch": {
      "post": {
        "operationId": "postFaxSendBatch",
        "tags": [
          "Faxes"
        ],
        "summary": "Send a fax to several numbers",
        "description": "Sends one document to up to 50 numbers. Each recipient becomes its own fax with its own id, charged just before it is sent, so the answer can mix outcomes: check each entry in `results`. If the balance runs out partway, the rest are returned as `not_attempted` and are not charged.\n\nA `scheduledAt` less than a minute away is sent now. The same document and cost rules as `POST /v1/fax/send` apply, per recipient.\n\nRequires the `fax:send` permission.",
        "x-scope": "fax:send",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "description": "Makes a retry safe: the same key with the same body within 24 hours returns the first response (with `Idempotent-Replayed: true`) instead of running again. Any value you choose, such as a UUID; a new one per request."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "documentId",
                  "destinationNumbers"
                ],
                "properties": {
                  "documentId": {
                    "type": "string",
                    "description": "The `id` from `POST /v1/documents/upload-url`."
                  },
                  "destinationNumbers": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "string"
                    },
                    "description": "The recipients. If any is not a valid fax number the whole batch is refused.",
                    "examples": [
                      [
                        "+12025550142",
                        "+12025550143"
                      ]
                    ]
                  },
                  "scheduledAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Send later, at this time: an ISO 8601 date-time with `Z` or an offset, at most one year ahead. Omit to send now."
                  },
                  "pageCount": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 500,
                    "description": "Pages in the document. Defaults to the count given at upload."
                  },
                  "cover": {
                    "description": "Put a cover sheet in front, charged as one more page. Omitted or `false`: no cover, even if a default cover is set to go on every fax. `\"default\"` or `true`: the default cover chosen under Settings → Cover sheet. `{ \"fields\": { ... } }`: the default cover with these fields filled in. `{ \"sheet\": \"irs\", \"fields\": { ... } }`: a sheet from the cover sheet library, named by the last part of its address (irs for faxdash.io/fax-cover-sheets/irs); a field the sheet does not have is refused. Saved cover details fill whatever `fields` leaves out, and the page count is filled in for you.",
                    "oneOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "default"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "sheet": {
                            "type": "string",
                            "description": "A cover sheet library slug, such as `irs`."
                          },
                          "fields": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            },
                            "description": "Field values by key."
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the stored response to an earlier request with the same `Idempotency-Key`. A replayed send carries no `X-RateLimit-*` headers: it uses no send.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BatchResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A required field is missing, more than 50 recipients, a number is not a valid fax number, `scheduledAt` is not a date-time with a timezone or is more than a year ahead, `pageCount` is not 1 to 500, or `cover` is malformed. Or: `Idempotency-Key` is not 1 to 255 printable ASCII characters (`code: idempotency_key_invalid`). Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Not enough credits for even the first recipient (`Insufficient credits. Need N for M recipients`), free signup credits used for a destination they do not cover (`code: purchase_required`), or a team member's monthly page limit reached (`code: member_cap_reached`). Nothing is charged. Or: The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key may not send this document (`code: document_not_from_key`), the destination is in a country FaxDash cannot fax (`code: destination_sanctioned`), sending is blocked on this account, or the caller's team role cannot send (`code: team_role`). Also the shared missing-permission refusal. Or: The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`Document not found` (`code: document_not_found`): no document with this `documentId` on the account, for example one that was deleted or expired; upload it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Every number on the account is connected to a fax machine (`code: sender_on_fax_machine`). Or `cover` asks for the default cover but none is chosen (`code: no_default_cover`). Or: A request with this `Idempotency-Key` is still running, or ended without a stored result (`code: idempotency_in_progress`). Retry shortly; if it persists, check `GET /v1/fax` before sending again under a new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "The upload expired before it was sent (`code: document_expired`). Uploads that are never sent are deleted after 24 hours; upload it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A cover cannot be added to this document (`code: cover_unsupported`). Send it without a cover. Or: This `Idempotency-Key` was already used with a different request (`code: idempotency_mismatch`). Use a new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The send could not be charged, the plan or purchase history could not be checked, or the document could not be read. Nothing was charged; retry shortly. Or: The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/upload-url": {
      "post": {
        "operationId": "postDocumentsUploadUrl",
        "tags": [
          "Documents"
        ],
        "summary": "Create an upload",
        "description": "Step one of sending: returns a document `id` and an `uploadUrl`. PUT the file to `uploadUrl` with the same `Content-Type` header and no API key. It is a presigned URL that carries its own authorization, valid for one hour; an `Authorization` header makes the upload fail. Then send the `id` with `POST /v1/fax/send`.\n\nAn upload that is never sent is deleted after 24 hours.\n\nRequires the `fax:send` permission.",
        "x-scope": "fax:send",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fileName",
                  "contentType"
                ],
                "properties": {
                  "fileName": {
                    "type": "string",
                    "description": "The file's name.",
                    "examples": [
                      "contract.pdf"
                    ]
                  },
                  "contentType": {
                    "type": "string",
                    "description": "Its media type, sent again as `Content-Type` on the upload.",
                    "examples": [
                      "application/pdf"
                    ]
                  },
                  "pageCount": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Pages in the document, used when a send does not give `pageCount`. Default 1."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id",
                        "uploadUrl"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The document id: the `documentId` to send."
                        },
                        "uploadUrl": {
                          "type": "string",
                          "format": "uri",
                          "description": "Where to PUT the file, for one hour."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/fax": {
      "get": {
        "operationId": "getFax",
        "tags": [
          "Faxes"
        ],
        "summary": "List sent faxes",
        "description": "The account's sent faxes, most recently updated first. In a team, every member's sends. Pages with `cursor`. The order is by last update, so a fax that changes status while you page moves: to follow a fax to its end, read `GET /v1/fax/{id}`.\n\nRequires the `fax:read` permission.",
        "x-scope": "fax:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "How many faxes to return, 1 to 100. Default 50. A larger number is treated as 100; anything that is not a whole number of at least 1 is a 400."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The `nextCursor` from the previous page, for the faxes after it. Opaque: send it back exactly as given. Without it you get the first page."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desc",
                "asc"
              ],
              "default": "desc"
            },
            "description": "`desc` (default) for most recently updated first, `asc` for least recently updated first. Keep it the same while paging."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Fax"
                      }
                    },
                    "nextCursor": {
                      "type": "string",
                      "description": "Present when more rows may remain: send it as `cursor` for the next page. With `since`, always present: send it as `since` next time (it is the same value back when nothing new has arrived)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`limit` is not a whole number of at least 1, `cursor` or `since` is not one this endpoint issued (or not a valid time), or both `cursor` and `since` were sent. Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/fax/{id}": {
      "get": {
        "operationId": "getFaxById",
        "tags": [
          "Faxes"
        ],
        "summary": "Get a sent fax",
        "description": "One sent fax and where it is. `status` ends at `delivered` or `failed`; a failed fax carries `failureDescription` to show people.\n\nRequires the `fax:read` permission.",
        "x-scope": "fax:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The fax id from the send."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Fax"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`Fax not found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inbox": {
      "get": {
        "operationId": "getInbox",
        "tags": [
          "Inbox"
        ],
        "summary": "List received faxes",
        "description": "Faxes received on the account's numbers, newest first. With `inbox:read` alone each entry carries only who sent it, where and when it arrived, its pages and whether it is read. With `inbox:content` too, entries add the AI summary and category and the stored file's `s3Key`. The extracted text and a download link come only from `GET /v1/inbox/{id}`.\n\nPage back through the inbox with `cursor`. To poll for new faxes, use `since`.\n\nRequires the `inbox:read` permission.",
        "x-scope": "inbox:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "How many received faxes to return, 1 to 100. Default 50. A larger number is treated as 100; anything that is not a whole number of at least 1 is a 400."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The `nextCursor` from the previous page, for the received faxes after it. Opaque: send it back exactly as given. Without it you get the first page."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only received faxes after this point, oldest first: a `nextCursor` from an earlier `since` response, or an ISO 8601 time (exclusive) to start from. Store the `nextCursor` of each response and send it as `since` next time: nothing is missed or repeated. Only received faxes at least two minutes old are returned, so one recorded a moment late is never skipped. Not together with `cursor`."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InboxItem"
                      }
                    },
                    "nextCursor": {
                      "type": "string",
                      "description": "Present when more rows may remain: send it as `cursor` for the next page. With `since`, always present: send it as `since` next time (it is the same value back when nothing new has arrived)."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "With `since` only: true when more rows are ready now, so ask again straight away."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`limit` is not a whole number of at least 1, `cursor` or `since` is not one this endpoint issued (or not a valid time), or both `cursor` and `since` were sent. Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inbox/unread": {
      "get": {
        "operationId": "getInboxUnread",
        "tags": [
          "Inbox"
        ],
        "summary": "Count unread faxes",
        "description": "How many received faxes are not marked read. Past 99, or on a very large inbox, the count stops and `atLeast` is true: show it as `99+`.\n\nRequires the `inbox:read` permission.",
        "x-scope": "inbox:read",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "unread",
                        "atLeast"
                      ],
                      "properties": {
                        "unread": {
                          "type": "integer",
                          "maximum": 99,
                          "description": "Unread faxes, exact when `atLeast` is false."
                        },
                        "atLeast": {
                          "type": "boolean",
                          "description": "True when `unread` is a lower bound."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inbox/numbers": {
      "get": {
        "operationId": "getInboxNumbers",
        "tags": [
          "Inbox"
        ],
        "summary": "List receiving numbers",
        "description": "The account's numbers that are receiving faxes into this inbox, sorted. Numbers connected to a fax machine are left out. Beside `data` the response also has `account: { email: null }`; the email is never given to an API key.\n\nRequires the `inbox:read` permission.",
        "x-scope": "inbox:read",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "number"
                        ],
                        "properties": {
                          "number": {
                            "type": "string",
                            "description": "A receiving number.",
                            "examples": [
                              "+12025550142"
                            ]
                          }
                        }
                      }
                    },
                    "account": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Always null for an API key."
                        }
                      },
                      "description": "The caller's account. Its email is never given to an API key."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inbox/{id}": {
      "get": {
        "operationId": "getInboxById",
        "tags": [
          "Inbox"
        ],
        "summary": "Open a received fax",
        "description": "One received fax with its content: the AI summary, the text read off its pages, and a link to the PDF valid for one hour. Opening it is recorded in the audit log.\n\nRequires the `inbox:content` permission.",
        "x-scope": "inbox:content",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The received fax id."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InboxItemDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`Received fax not found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The view could not be recorded in the audit log, so nothing was returned. Retry shortly. Or: The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteInboxById",
        "tags": [
          "Inbox"
        ],
        "summary": "Delete a received fax",
        "description": "Removes it from the inbox. Deleting an id that is not there also answers 204.\n\nRequires the `inbox:write` permission.",
        "x-scope": "inbox:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The received fax id."
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted. No body.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The delete could not be recorded in the audit log, so it was not made. Retry shortly. Or: The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inbox/{id}/read": {
      "put": {
        "operationId": "putInboxByIdRead",
        "tags": [
          "Inbox"
        ],
        "summary": "Mark a received fax read",
        "description": "Sets `status` to `read` and records `readAt`. No request body.\n\nRequires the `inbox:write` permission.",
        "x-scope": "inbox:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The received fax id."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id",
                        "status"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "read"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`Received fax not found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The change could not be recorded in the audit log, so it was not made. Retry shortly. Or: The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents": {
      "get": {
        "operationId": "getDocuments",
        "tags": [
          "Documents"
        ],
        "summary": "List documents",
        "description": "Documents on the account: uploads for sending and PDFs that arrived by email-to-fax. Not the scan library, which no key permission covers. Not paginated and in no particular order.\n\nRequires the `documents:read` permission.",
        "x-scope": "documents:read",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Document"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/download-url": {
      "get": {
        "operationId": "getDocumentsDownloadUrl",
        "tags": [
          "Documents"
        ],
        "summary": "Get a download link",
        "description": "A presigned link to a stored file, valid for one hour. Fetch it without your API key. `key` is a `s3Key` from this API: a document's (`documents:read`), a sent fax's, or a received fax's (which also needs `inbox:content`). Scans are not available to keys.\n\nRequires the `documents:read` permission.",
        "x-scope": "documents:read",
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The `s3Key` of a document, sent fax or received fax on this account."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "downloadUrl"
                      ],
                      "properties": {
                        "downloadUrl": {
                          "type": "string",
                          "format": "uri",
                          "description": "The link, valid for one hour."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`Not authorized to access this object`: the key does not belong to this account. Or a scan (`code: scope_not_available`), or a received fax without `inbox:content` (`code: missing_scope`). Or: The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The download could not be recorded in the audit log, so no link was made. Retry shortly. Or: The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts": {
      "get": {
        "operationId": "getContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "List contacts",
        "description": "The account's saved contacts. Not paginated and in no particular order.\n\nRequires the `contacts:read` permission.",
        "x-scope": "contacts:read",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Contact"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "Add a contact",
        "description": "Saves a contact. The number is checked as `POST /v1/fax/send` checks a destination and saved in E.164 form. Duplicates are not merged: adding a number the account already has saves a second contact.\n\nRequires the `contacts:write` permission.",
        "x-scope": "contacts:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "description": "Makes a retry safe: the same key with the same body within 24 hours returns the first response (with `Idempotent-Replayed: true`) instead of running again. Any value you choose, such as a UUID; a new one per request."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "faxNumber"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "examples": [
                      "Accounts payable"
                    ]
                  },
                  "faxNumber": {
                    "type": "string",
                    "description": "E.164 (`+` and the country code) is safest; 10 digits, or 11 starting with 1, are read as a +1 number.",
                    "examples": [
                      "+12025550133"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the stored response to an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id",
                        "name",
                        "faxNumber",
                        "createdAt"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "faxNumber": {
                          "type": "string",
                          "description": "The number as saved, in E.164 form."
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When it was added."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`name` or `faxNumber` is missing, or the number is not a valid fax number. Or: `Idempotency-Key` is not 1 to 255 printable ASCII characters (`code: idempotency_key_invalid`). Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A request with this `Idempotency-Key` is still running, or ended without a stored result (`code: idempotency_in_progress`). Retry shortly; if it persists, check `GET /v1/fax` before sending again under a new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "This `Idempotency-Key` was already used with a different request (`code: idempotency_mismatch`). Use a new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/{id}": {
      "put": {
        "operationId": "putContactsById",
        "tags": [
          "Contacts"
        ],
        "summary": "Change a contact",
        "description": "Changes the fields given; the others stay as they are. An empty value is ignored rather than cleared. A new `faxNumber` is checked and saved in E.164 form, as on `POST /v1/contacts`.\n\nRequires the `contacts:write` permission.",
        "x-scope": "contacts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The contact id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "faxNumber": {
                    "type": "string",
                    "examples": [
                      "+12025550134"
                    ]
                  },
                  "lastUsedAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the contact was last used."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id",
                        "updated"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "updated": {
                          "type": "boolean",
                          "enum": [
                            true
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The number is not a valid fax number. Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`Contact not found`: no contact with this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteContactsById",
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact",
        "description": "Deleting an id that is not there also answers 204.\n\nRequires the `contacts:write` permission.",
        "x-scope": "contacts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The contact id."
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted. No body.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/credits": {
      "get": {
        "operationId": "getCredits",
        "tags": [
          "Credits"
        ],
        "summary": "Get the credit balance",
        "description": "Send credits and received-page allowance for the key owner's own account. A team member's sends spend the team owner's credits, so for a member's key this is their personal balance, not the one sends draw on (unless the member has the finance role, when `scope` is `team`).\n\nRequires the `credits:read` permission.",
        "x-scope": "credits:read",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CreditBalance"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/credits/history": {
      "get": {
        "operationId": "getCreditsHistory",
        "tags": [
          "Credits"
        ],
        "summary": "List credit transactions",
        "description": "The key owner's credit ledger, newest first: sends, refunds, received pages and grants. A member with the finance role reads the team owner's. Pages with `cursor`. Entries with no `createdAt` (none are written today) come last.\n\nRequires the `credits:read` permission.",
        "x-scope": "credits:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "How many entries to return, 1 to 100. Default 50. A larger number is treated as 100; anything that is not a whole number of at least 1 is a 400."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The `nextCursor` from the previous page, for the entries after it. Opaque: send it back exactly as given. Without it you get the first page."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CreditTransaction"
                      }
                    },
                    "nextCursor": {
                      "type": "string",
                      "description": "Present when more rows may remain: send it as `cursor` for the next page. With `since`, always present: send it as `since` next time (it is the same value back when nothing new has arrived)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`limit` is not a whole number of at least 1, `cursor` or `since` is not one this endpoint issued (or not a valid time), or both `cursor` and `since` were sent. Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api-usage": {
      "get": {
        "operationId": "getApiUsage",
        "tags": [
          "Credits"
        ],
        "summary": "Get this month's API usage",
        "description": "API-key requests the account has made this calendar month (UTC) against its allowance. In a team, the team owner's count, which every member's keys add to. Requests over the allowance keep working and are not charged. The request asking may not be counted yet.\n\nRequires the `credits:read` permission.",
        "x-scope": "credits:read",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiUsage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/numbers": {
      "get": {
        "operationId": "getNumbers",
        "tags": [
          "Numbers"
        ],
        "summary": "List fax numbers",
        "description": "The numbers the account rents that are active or in their grace period. Renting and releasing numbers need a signed-in session.\n\nRequires the `numbers:read` permission.",
        "x-scope": "numbers:read",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FaxNumber"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/audit": {
      "get": {
        "operationId": "getAudit",
        "tags": [
          "Audit"
        ],
        "summary": "Read the audit log",
        "description": "The account's audit log, newest first. In a team, the team owner's log: a teammate's entries carry no IP address. What a key did carries its id in `actorKeyId`; changes made to a key carry its id in `resourceId`.\n\nPage back with `cursor`; export new entries in order with `since`. With `resourceId`, one request reads at most the next 2,000 entries looking for matches; when it stops short the response has `truncated: true` and a `nextCursor` to carry on from. An account deleted before 2026-10-09 and signed up again may hold one `account_deleted` entry whose `id` is not time-ordered: newest first lists it at the top or bottom, and `since` from a time usually returns it first, by its `timestamp`. Entries written before Oct 2026 by account deletion may be missing from `since=` results.\n\nRequires the `audit:read` permission.",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "How many entries to return, 1 to 100. Default 50. A larger number is treated as 100; anything that is not a whole number of at least 1 is a 400."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The `nextCursor` from the previous page, for the entries after it. Opaque: send it back exactly as given. Without it you get the first page."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only entries after this point, oldest first: a `nextCursor` from an earlier `since` response, or an ISO 8601 time (exclusive) to start from. Store the `nextCursor` of each response and send it as `since` next time: nothing is missed or repeated. Only entries at least two minutes old are returned, so one recorded a moment late is never skipped. Not together with `cursor`."
          },
          {
            "name": "resourceId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only entries about this resource, such as a fax id or an API key id."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      }
                    },
                    "nextCursor": {
                      "type": "string",
                      "description": "Present when more rows may remain: send it as `cursor` for the next page. With `since`, always present: send it as `since` next time (it is the same value back when nothing new has arrived)."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "With `since` only: true when more rows are ready now, so ask again straight away."
                    },
                    "truncated": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Present, and true, when the search stopped with older entries unread and the page not full: continue with `nextCursor`."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`limit` is not a whole number of at least 1, `cursor` or `since` is not one this endpoint issued (or not a valid time), or both `cursor` and `since` were sent. Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "getWebhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook endpoints",
        "description": "The account's webhook endpoints, oldest first. In a team, the team owner's, and only a team admin may read or change them.\n\nRequires the `webhooks:manage` permission.",
        "x-scope": "webhooks:manage",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookEndpoint"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postWebhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "Add a webhook endpoint",
        "description": "Adds an endpoint that will receive the events it names. An account can have up to 10. The url must be `https`, must not contain a user name or password, and must not point to a private, loopback or link-local address (it is checked again before each delivery). Adding an endpoint from a signed-in session needs the Business plan too.\n\nRequires the `webhooks:manage` permission.",
        "x-scope": "webhooks:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "events"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048,
                    "examples": [
                      "https://example.com/faxdash/webhook"
                    ]
                  },
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "fax.delivered",
                        "fax.failed",
                        "fax.received"
                      ]
                    },
                    "description": "One or more of `fax.delivered`, `fax.failed` and `fax.received`. Repeats are ignored."
                  },
                  "enabled": {
                    "type": "boolean",
                    "default": true
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "A note for yourself, such as which system receives it."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`url` is missing, not `https`, not a valid URL, or points to an address that is not allowed; `events` is empty or names an unknown event; `enabled` is not a boolean; or `description` is too long. Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The account already has 10 endpoints (`code: webhook_endpoint_limit`). Delete one first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "get": {
        "operationId": "getWebhooksById",
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a webhook endpoint",
        "description": "Requires the `webhooks:manage` permission.",
        "x-scope": "webhooks:manage",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The endpoint id."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`Webhook endpoint not found`: no endpoint with this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchWebhooksById",
        "tags": [
          "Webhooks"
        ],
        "summary": "Change a webhook endpoint",
        "description": "Changes the fields given; the others stay as they are. A new `url` is checked as on `POST /v1/webhooks`. `description: null` (or an empty string) removes the note.\n\nRequires the `webhooks:manage` permission.",
        "x-scope": "webhooks:manage",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The endpoint id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "fax.delivered",
                        "fax.failed",
                        "fax.received"
                      ]
                    }
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Nothing to change, or a field is invalid as on `POST /v1/webhooks`. Or: The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`Webhook endpoint not found`: no endpoint with this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhooksById",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook endpoint",
        "description": "Deletes the endpoint; nothing more is sent to it.\n\nRequires the `webhooks:manage` permission.",
        "x-scope": "webhooks:manage",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The endpoint id."
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted. No body.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request is invalid. `error` says what is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, unknown, revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The account is not on the Business plan (`code: business_plan_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the permission this operation needs (`code: missing_scope`, with `scope`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`Webhook endpoint not found`: no endpoint with this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over a rate limit (`code: rate_limited`, with `retryAfter`, `limit`, `scope` (`key` or `account`) and `class`). Retry after the `Retry-After` seconds.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The plan could not be checked right now. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "An API key, `fxk_…`."
      },
      "Bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "The same API key as a bearer token."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, readable by a person."
          },
          "code": {
            "type": "string",
            "description": "A stable machine-readable reason, when there is one."
          }
        },
        "additionalProperties": true
      },
      "Fax": {
        "type": "object",
        "description": "A fax sent from the account. Fields that do not apply to a fax are absent.",
        "required": [
          "id",
          "status",
          "destinationNumber",
          "pageCount",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The fax id."
          },
          "documentId": {
            "type": "string",
            "description": "The document that was sent."
          },
          "destinationNumber": {
            "type": "string",
            "description": "Where the fax went, in E.164 form.",
            "examples": [
              "+12025550142"
            ]
          },
          "fromNumber": {
            "type": "string",
            "description": "The account's number the fax went out under, when it rents one. Absent when sent from the shared FaxDash number.",
            "examples": [
              "+12025550142"
            ]
          },
          "status": {
            "type": "string",
            "description": "Where the fax is. `scheduled`: booked for `scheduledAt`. `queued`, `claimed`, `submitting`: charged and on its way to the carrier. `sending`: with the carrier. `retrying`: an attempt failed and another is booked for `nextRetryAt`. `delivered` and `failed` are final.",
            "examples": [
              "sending"
            ]
          },
          "pageCount": {
            "type": "integer",
            "description": "Pages charged for, including a cover sheet."
          },
          "scheduledAt": {
            "type": "string",
            "description": "When a scheduled fax is due, in UTC (ISO 8601)."
          },
          "batchId": {
            "type": "string",
            "format": "uuid",
            "description": "Present when the fax was one recipient of a batch send."
          },
          "source": {
            "type": "string",
            "description": "Which kind of client sent it: `app`, `web`, `agent` (an AI assistant), `api` (an API key) or `email` (email-to-fax). Absent on batch sends made before November 2026."
          },
          "clientId": {
            "type": "string",
            "description": "The AI assistant's client id, when an assistant sent it."
          },
          "sentBy": {
            "type": "string",
            "description": "The user id of the person who sent it. In a team this is the member; otherwise the account itself."
          },
          "sentByEmail": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sender's email when they are a current team member or the caller, else null."
          },
          "sentByName": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sender's name when known, else null."
          },
          "s3Key": {
            "type": "string",
            "description": "The stored file this fax sends. Pass it as `key` to `GET /v1/documents/download-url` (needs `documents:read`)."
          },
          "retryCount": {
            "type": "integer",
            "description": "Retries made so far."
          },
          "maxRetries": {
            "type": "integer",
            "description": "Retries allowed for this fax."
          },
          "nextRetryAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the next attempt is due, while `status` is `retrying`."
          },
          "lastFailureReason": {
            "type": "string",
            "description": "The carrier's reason for the most recent failed attempt."
          },
          "failureReasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The carrier's reason for each failed attempt, oldest first."
          },
          "errorMessage": {
            "type": "string",
            "description": "The carrier's reason for the final failure. Raw provider wording: show `failureDescription` to people."
          },
          "failureDescription": {
            "type": "string",
            "description": "On a failed fax: what went wrong, in plain English."
          },
          "failureCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "On a failed fax: the known failure code inside the reason, or null when there is none."
          },
          "failedAtFarEnd": {
            "type": "boolean",
            "description": "On a failed fax: true when the cause was on the receiving side (busy, declined, not a fax line, no such number)."
          },
          "refundPending": {
            "type": "boolean",
            "description": "True when a failed fax is owed a refund that has not been recorded yet."
          },
          "lastAttemptT38": {
            "type": "boolean",
            "description": "Whether the latest retry attempt used T.38."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the send was made."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the fax last changed."
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it reached `delivered` or `failed`."
          }
        }
      },
      "BatchResult": {
        "type": "object",
        "required": [
          "batchId",
          "results"
        ],
        "properties": {
          "batchId": {
            "type": "string",
            "format": "uuid",
            "description": "Shared by every fax in the batch (each fax carries it as `batchId`)."
          },
          "results": {
            "type": "array",
            "description": "One entry per recipient.",
            "items": {
              "type": "object",
              "required": [
                "destinationNumber",
                "faxId",
                "status"
              ],
              "properties": {
                "destinationNumber": {
                  "type": "string",
                  "description": "The recipient, in E.164 form.",
                  "examples": [
                    "+12025550142"
                  ]
                },
                "faxId": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The fax id for this recipient. Follow it with `GET /v1/fax/{id}`."
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "sending",
                    "scheduled",
                    "failed",
                    "not_attempted"
                  ],
                  "description": "`sending` or `scheduled`: on its way and charged. `failed`: the carrier refused it and it was refunded. `not_attempted`: the batch stopped before this recipient (usually the balance ran out); it was not charged."
                }
              }
            }
          }
        }
      },
      "Document": {
        "type": "object",
        "description": "A document on the account: an upload for sending, or a PDF that arrived by email-to-fax.",
        "required": [
          "id",
          "s3Key",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The document id: the `documentId` to send."
          },
          "fileName": {
            "type": "string",
            "description": "The file name given at upload."
          },
          "s3Key": {
            "type": "string",
            "description": "Where the file is stored. Pass it as `key` to `GET /v1/documents/download-url`."
          },
          "pageCount": {
            "type": "integer",
            "description": "Pages, as declared at upload (default 1)."
          },
          "fileSizeBytes": {
            "type": "integer",
            "description": "Size in bytes, where recorded. 0 for an API upload."
          },
          "uploadedByKey": {
            "type": "string",
            "description": "The id of the API key that uploaded it, when a key did."
          },
          "usedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When a send first used it. Absent on an upload that has never been sent, which is deleted 24 hours after upload."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it was uploaded."
          }
        }
      },
      "InboxItem": {
        "type": "object",
        "description": "A fax received on one of the account's numbers. A key without `inbox:content` gets only `id`, `fromNumber`, `toNumber`, `pageCount`, `status`, `receivedAt` and `readAt`.",
        "required": [
          "id",
          "fromNumber",
          "toNumber",
          "pageCount",
          "status",
          "receivedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The received fax id."
          },
          "fromNumber": {
            "type": "string",
            "description": "The sender's number, or `unknown` when the caller withheld it.",
            "examples": [
              "+12025550117"
            ]
          },
          "toNumber": {
            "type": "string",
            "description": "The account's number it arrived on.",
            "examples": [
              "+12025550142"
            ]
          },
          "pageCount": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "received",
              "read",
              "download_failed"
            ],
            "description": "`received`: unread. `read`: marked read. `download_failed`: the pages could not be fetched yet and are being retried; there is nothing to download."
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it arrived."
          },
          "readAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it was marked read."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it was stored. Needs `inbox:content`."
          },
          "s3Key": {
            "type": "string",
            "description": "Where the PDF is stored (empty while `download_failed`). Needs `inbox:content`."
          },
          "fileSizeBytes": {
            "type": "integer",
            "description": "PDF size in bytes. Needs `inbox:content`."
          },
          "aiSummary": {
            "type": "string",
            "description": "A short summary read off the pages, when AI analysis ran. Needs `inbox:content`."
          },
          "aiCategory": {
            "type": "string",
            "description": "What kind of document it looks like: invoice, medical, legal, insurance, government, personal, business or other. Needs `inbox:content`."
          },
          "aiStatus": {
            "type": "string",
            "description": "Why there is no summary, when analysis did not produce one: `timed_out`, `failed`, `disabled` or `too_many_pages`. Needs `inbox:content`."
          }
        }
      },
      "InboxItemDetail": {
        "description": "A received fax with its content.",
        "allOf": [
          {
            "$ref": "#/components/schemas/InboxItem"
          },
          {
            "type": "object",
            "properties": {
              "downloadUrl": {
                "type": "string",
                "format": "uri",
                "description": "A presigned link to the PDF, valid for one hour. Fetch it without your API key. Absent when the pages were never stored (`status: download_failed`)."
              },
              "aiExtractedText": {
                "type": "string",
                "description": "The text read off the pages, when AI analysis ran."
              },
              "aiKeyFields": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Fields picked out of the pages, such as an invoice number or a due date."
              }
            }
          }
        ]
      },
      "Contact": {
        "type": "object",
        "required": [
          "id",
          "name",
          "faxNumber"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The contact id."
          },
          "name": {
            "type": "string"
          },
          "faxNumber": {
            "type": "string",
            "description": "In E.164 form. Contacts saved before November 2026 keep the form they were saved in.",
            "examples": [
              "+12025550133"
            ]
          },
          "lastUsedAt": {
            "type": "string",
            "description": "When it was last used, as set by the client that used it."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it was added."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed."
          }
        }
      },
      "WebhookEndpoint": {
        "type": "object",
        "required": [
          "id",
          "url",
          "events",
          "enabled",
          "description",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint id, `whe_` and 24 hex characters.",
            "examples": [
              "whe_0123456789abcdef01234567"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Where events are sent. Always `https`.",
            "examples": [
              "https://example.com/faxdash/webhook"
            ]
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "fax.delivered",
                "fax.failed",
                "fax.received"
              ]
            },
            "description": "The events sent to this endpoint."
          },
          "enabled": {
            "type": "boolean",
            "description": "`false` pauses the endpoint without deleting it."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your note about the endpoint, up to 200 characters."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it was added."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed."
          }
        }
      },
      "CreditBalance": {
        "type": "object",
        "required": [
          "credits",
          "granted",
          "used",
          "receivePages",
          "receiveGranted",
          "receiveUsed",
          "receiveOveragePages",
          "scope"
        ],
        "properties": {
          "credits": {
            "type": "integer",
            "description": "Send credits available now. One credit is one page to a +1 number; elsewhere a page costs two."
          },
          "granted": {
            "type": "integer",
            "description": "Send credits ever granted: signup credits, packs, plan periods, refunds and bonuses."
          },
          "used": {
            "type": "integer",
            "description": "Send credits spent, including received pages charged past the receive allowance."
          },
          "receivePages": {
            "type": "integer",
            "description": "Received pages left in this period's allowance."
          },
          "receiveGranted": {
            "type": "integer",
            "description": "This period's received-page allowance (0 without a plan that includes one)."
          },
          "receiveUsed": {
            "type": "integer",
            "description": "Received pages counted against the allowance this period."
          },
          "receivePeriodEnd": {
            "type": "string",
            "format": "date-time",
            "description": "When the receive allowance resets. Absent when there is no period to reset."
          },
          "receiveOveragePages": {
            "type": "integer",
            "description": "Received pages this period past the allowance, charged to send credits. Already inside `used`."
          },
          "scope": {
            "type": "string",
            "enum": [
              "personal",
              "team"
            ],
            "description": "Whose balance this is. `personal`: the key owner's own account. `team`: the team owner's, returned to a member with the finance role."
          },
          "teamId": {
            "type": "string",
            "description": "The team, when `scope` is `team`."
          },
          "receivePlan": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "starter",
              "standard",
              "business",
              null
            ],
            "description": "The live receive plan's tier; null without one or when billing could not be read."
          },
          "unlimited": {
            "type": [
              "object",
              "null"
            ],
            "description": "The unlimited sending plan's pages this month; null without one. Absent when it could not be checked. Pages to a +1 US or Canadian number count once, elsewhere twice. Past either limit, faxes use credits.",
            "required": [
              "tier",
              "limit",
              "used",
              "dailyLimit",
              "dayUsed",
              "resetAt"
            ],
            "properties": {
              "tier": {
                "type": "string",
                "enum": [
                  "send",
                  "plus",
                  "business"
                ]
              },
              "limit": {
                "type": "integer",
                "description": "Pages a month."
              },
              "used": {
                "type": "integer",
                "description": "Pages counted this month."
              },
              "dailyLimit": {
                "type": "integer",
                "description": "Pages a day."
              },
              "dayUsed": {
                "type": "integer",
                "description": "Pages counted today (UTC)."
              },
              "resetAt": {
                "type": "string",
                "format": "date-time",
                "description": "When the monthly count resets."
              }
            }
          }
        }
      },
      "CreditTransaction": {
        "type": "object",
        "description": "One entry in the credit ledger.",
        "required": [
          "id",
          "amount",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "amount": {
            "type": "integer",
            "description": "Positive for credits added (refunds, grants), negative for credits spent or pages received."
          },
          "type": {
            "type": "string",
            "description": "What the entry is, for example `fax_send`, `refund`, `fax_receive`, `receive_overage` or `subscription_grant`. Older entries may have none."
          },
          "description": {
            "type": "string",
            "description": "A readable line, such as the destination and page count of a send."
          },
          "faxId": {
            "type": "string",
            "description": "The fax this entry is for, when there is one."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it was recorded."
          }
        }
      },
      "ApiUsage": {
        "type": "object",
        "required": [
          "month",
          "used",
          "allowance",
          "overage"
        ],
        "properties": {
          "month": {
            "type": "string",
            "description": "The calendar month counted, UTC, as YYYY-MM.",
            "examples": [
              "2026-11"
            ]
          },
          "used": {
            "type": "integer",
            "description": "API-key requests the account has made this month."
          },
          "allowance": {
            "type": "integer",
            "description": "Requests included each month for this account: 10,000 on Business, or the account's own allowance on Enterprise.",
            "examples": [
              10000
            ]
          },
          "overage": {
            "type": "integer",
            "description": "Requests past the allowance. They are counted, not charged."
          }
        }
      },
      "FaxNumber": {
        "type": "object",
        "description": "A fax number the account rents. Fields that do not apply are absent.",
        "required": [
          "phoneNumber",
          "status"
        ],
        "properties": {
          "phoneNumber": {
            "type": "string",
            "description": "The number.",
            "examples": [
              "+12025550142"
            ]
          },
          "displayName": {
            "type": "string",
            "description": "Its label (the number itself unless renamed)."
          },
          "numberType": {
            "type": "string",
            "description": "The kind of number, such as `local` or `toll_free`."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "grace_period"
            ],
            "description": "`active`, or `grace_period`: the subscription that pays for it has lapsed and it will be released at `gracePeriodEndsAt` unless renewed."
          },
          "gracePeriodEndsAt": {
            "type": "string",
            "format": "date-time",
            "description": "When a number in its grace period is released."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether faxes go out under this number by default."
          },
          "monthlyCredits": {
            "type": "integer",
            "description": "Credits the number costs each month."
          },
          "monthlyCost": {
            "description": "The provider's monthly price for the number."
          },
          "provisionedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the account got it."
          },
          "nextBillingAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it is next charged."
          },
          "releaseBlocked": {
            "type": "boolean",
            "description": "True when the number is protected from release, for example while it is being ported out."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed."
          }
        }
      },
      "AuditEntry": {
        "type": "object",
        "required": [
          "id",
          "action",
          "resourceType",
          "resourceId",
          "timestamp"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The entry id: its timestamp followed by a short random suffix."
          },
          "action": {
            "type": "string",
            "description": "What happened, such as `fax.sent`, `fax.received`, `document.viewed`, `document.downloaded`, `document.deleted`, `document.updated`, `number.provisioned`, `key.created`, `key.rotated`, `key.revoked`, `key.expired`, `key.scopes_changed`, `webhook.created`, `webhook.updated`, `webhook.deleted` or `user.login`."
          },
          "resourceType": {
            "type": "string",
            "description": "The kind of thing acted on, such as `fax`, `received_fax`, `document` or `api_key`."
          },
          "resourceId": {
            "type": "string",
            "description": "What was acted on. For changes to an API key, the key's id."
          },
          "actorUserId": {
            "type": "string",
            "description": "The person who did it. In a team, the member; otherwise the account."
          },
          "actorKeyId": {
            "type": "string",
            "description": "The API key that did it, when a key did."
          },
          "actorClientId": {
            "type": "string",
            "description": "The AI assistant that did it, when one did."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Details of the action, which vary by `action`."
          },
          "ipAddress": {
            "type": "string",
            "description": "Where the request came from. Empty for an entry made by another team member, and where none was recorded."
          },
          "userAgent": {
            "type": "string",
            "description": "The client's user agent, where recorded."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened."
          }
        }
      }
    },
    "headers": {
      "RateLimitLimit": {
        "description": "Requests the bucket holds when full: the key's or the account's, whichever is closer to empty.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in that bucket right now.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "Seconds until that bucket is full again.",
        "schema": {
          "type": "integer"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying. On a 429 only.",
        "schema": {
          "type": "integer"
        }
      }
    }
  },
  "x-scopes": [
    "fax:send",
    "fax:read",
    "inbox:read",
    "inbox:content",
    "inbox:write",
    "documents:read",
    "contacts:read",
    "contacts:write",
    "credits:read",
    "numbers:read",
    "audit:read",
    "webhooks:manage"
  ]
}
