Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@
All notable changes to the public OpenAPI document are listed here. The version is the API's
`info.version` as served at `https://api.faxforagents.com/openapi.json`.

## 1.21.2 (2026-11-16)

API version 1.21.2, curated from the server document at that release. 132 paths, 165 operations and
175 schemas, the same as 1.21.0. No operation or schema is new. This document skips 1.21.1, which
changed only `info.version` here.

- `Subscription` gains `cancel_at` and `ends_at`. Both are required and nullable. `cancel_at` is
when Stripe is set to end the subscription. A cancel in the billing portal sets it to the end of the
period and leaves `cancel_at_period_end` false.
- `ends_at` is when the plan ends without another charge. It is `cancel_at` when that comes no later
than `current_period_end`, or `current_period_end` after a cancel at the period's end. It is null
while the plan renews, and once the plan has ended.
- `create_subscription_checkout` gains a description. It answers the address of Stripe's payment page
for the plan.
- Its 409 has its own text, written by the server. `error.code` is `conflict` and
`error.details.reason` says why. `plan_active` means the plan is active, here or at Stripe right
after a payment. `checkout_open` means a Checkout of the plan is still open. Then `error.details.url`
is its page and `error.details.expires_at` is when it closes. The same 409 names
`idempotency_key_conflict`.
- `OneTimeConfirmSummary.state` gains `link_canceled`, for an order that was canceled with its hold
released. The description of the schema names it.
- The 409 of `confirm_one_time_order` names `link_canceled` too. The server answers it since 1.21.2 and
its document names only the shared 409, so `scripts/curate.py` writes the code.
- The descriptions of `get_fax_history_csv` and of its 403 name both scopes. `x-required-scope` is
`fax:read`, and the export needs `inbox:read` as well.
- The description of `OneTimeOrder` is split into shorter sentences. Its fields do not change.

## 1.21.0 (2026-11-16)

API version 1.21.0, curated from the server document at that release. 132 paths, 165 operations and
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repository holds the public OpenAPI document of the API.

| File | What it is |
|---|---|
| [`openapi.yaml`](openapi.yaml) | OpenAPI 3.1, 165 operations in 132 paths, 175 schemas, version 1.21.0 |
| [`openapi.yaml`](openapi.yaml) | OpenAPI 3.1, 165 operations in 132 paths, 175 schemas, version 1.21.2 |
| [`docs/`](docs/) | The rendered reference, published at <https://faxforagents.github.io/openapi/> |
| [`docs/llms.txt`](docs/llms.txt) | The same contract written for a model |
| [`scripts/curate.py`](scripts/curate.py) | Produces `openapi.yaml` from the server's own document |
Expand Down Expand Up @@ -109,6 +109,13 @@ with it. While the plan is active, each credential may make 3000 requests a minu
`RateLimit-Limit` header of every answer. The plan pays the monthly charge of the oldest live local
number, and that number reads `included_with_workspace` true.

`POST /v1/subscriptions/checkout` answers the address of Stripe's payment page for the plan. While the
plan is active, or a payment page for it is still open, the answer is 409 `conflict`, so the plan is
never paid twice. `error.details.reason` is then `plan_active` or `checkout_open`, and `checkout_open`
carries the open page's `url` and its `expires_at`. Each subscription names `cancel_at`, the end date
Stripe holds, and `ends_at`, when the plan ends without another charge. `ends_at` is null while the plan
renews, and once the plan has ended.

`GET /v1/records/faxes.csv` and `GET /v1/records/audit.csv` export the fax history and the audit trail
as CSV, for a range of UTC days. They answer while the plan is active and for 30 days after it ended.
Otherwise the answer is 403 `workspace_required`. The fax history needs `inbox:read` as well as
Expand Down Expand Up @@ -149,8 +156,9 @@ The person who pays accepts the acceptable use policy and the terms, never a key
order starts with `aup_accepted` false and carries a `status_url`, the order's page. Hand that link to
the person who pays. They accept the terms there and the checkout opens. `queue` on the config and on the order says whether a
fax would wait for a carrier line, with `jobs_ahead` and `estimated_wait_minutes`. The confirm page
reads a mailed link with `POST /v1/one-time-sends/by-token` and the token in the body. The older
`GET /v1/one-time-sends/by-token/{token}` is deprecated.
reads a mailed link with `POST /v1/one-time-sends/by-token` and the token in the body. The answer's
`state` is `link_canceled` once the order was canceled, and a confirm then answers 409 `link_canceled`.
The older `GET /v1/one-time-sends/by-token/{token}` is deprecated.

## States

Expand Down Expand Up @@ -216,8 +224,8 @@ The errors an operation can answer are declared on it. The shared ones are in `c
401, 402, 403, 404, 409, 410, 413, 422, 429 and 503, each the envelope above. Where the shared words are
not true of a route, it carries its own. The document and inbox routes name their 410. The billing routes
that refuse a test key name `environment_not_billable` under 403, and the records export names
`workspace_required` there. Key rotation, top-up cancel and the replay of a webhook delivery name the
`details` of their 409. A field that fails validation answers 422
`workspace_required` there. Key rotation, top-up cancel, the replay of a webhook delivery and the
workspace checkout name the `details` of their 409. A field that fails validation answers 422
`invalid_request` in the same envelope.
Repeat a mutating call with the same `Idempotency-Key` and the same resource comes back with
`Idempotent-Replayed: true`.
Expand Down
2 changes: 1 addition & 1 deletion docs/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A fax job is `queued`, `active`, `partial`, `failed`, `unknown` or `delivered`.

Errors are one envelope: `{"error": {"code", "message", "retryable", "correlation_id", "details"}}`. Rate limits answer 429 with `Retry-After`.

Base URL: https://api.faxforagents.com. Version 1.21.0.
Base URL: https://api.faxforagents.com. Version 1.21.2.
Authentication: `Authorization: Bearer ffa_live_...` or `X-API-Key`. Test keys are `ffa_test_...` and reach the sandbox only.

## Documents
Expand Down
19 changes: 10 additions & 9 deletions docs/reference.html

Large diffs are not rendered by default.

58 changes: 44 additions & 14 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ info:
x-logo:
url: https://faxforagents.com/brand/logo-512.png
altText: Fax for Agents
version: 1.21.0
version: 1.21.2
servers:
- url: https://api.faxforagents.com
description: Production (live and test keys)
Expand Down Expand Up @@ -3647,6 +3647,8 @@ paths:
tags:
- billing
summary: Open a hosted Checkout for the Agent workspace subscription
description: Answers the address of Stripe's payment page for the plan. It is refused with 409 while the plan
is active or a Checkout of it is still open, so the plan is never paid twice.
operationId: create_subscription_checkout
responses:
'201':
Expand All @@ -3671,7 +3673,15 @@ paths:
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
description: 'The plan cannot be bought twice. error.code is conflict and error.details.reason says why.
"plan_active": the Agent workspace is active, here or at Stripe after a payment of a moment ago. "checkout_open":
a Checkout of the plan is still open, and error.details.url is its page, error.details.expires_at when
it closes. idempotency_key_conflict: the Idempotency-Key was used with a different request, or that
request is still being processed.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'410':
$ref: '#/components/responses/Gone'
'422':
Expand Down Expand Up @@ -4412,10 +4422,10 @@ paths:
tags:
- organizations
summary: 'The fax history as CSV: every fax sent and received in the range'
description: 'One line per fax of the key''s environment, sent and received, oldest first. A sent fax counts
by when it was created and a received one by when it arrived. The lines carry what each fax cost the wallet,
never the document or its text. A range of more than 20000 lines answers 422: choose fewer days. Needs the
scopes fax:read and inbox:read.'
description: 'Needs two scopes: fax:read, which x-required-scope names, and inbox:read as well. One line per
fax of the key''s environment, sent and received, oldest first. A sent fax counts by when it was created
and a received one by when it arrived. The lines carry what each fax cost the wallet, never the document
or its text. A range of more than 20000 lines answers 422: choose fewer days.'
operationId: get_fax_history_csv
parameters:
- name: from
Expand Down Expand Up @@ -4448,9 +4458,10 @@ paths:
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: error.code is workspace_required while the organization's Agent workspace plan is not active
description: 'error.code is workspace_required while the organization''s Agent workspace plan is not active
and ended more than 30 days ago, or never started. error.details.ended_at is when it ended and error.details.closed_at
when the export closed. scope_missing names a scope the credential lacks.
when the export closed. scope_missing names a scope the credential lacks: fax:read, or inbox:read, which
this export needs as well.'
content:
application/json:
schema:
Expand Down Expand Up @@ -8983,8 +8994,8 @@ paths:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'409':
description: The link was already used (link_used), expired (link_expired), or the browser is signed in
as someone else (link_other_session).
description: The link was already used (link_used), its order was canceled and the hold released (link_canceled),
it expired (link_expired), or the browser is signed in as someone else (link_other_session).
content:
application/json:
schema:
Expand Down Expand Up @@ -13444,6 +13455,7 @@ components:
enum:
- ok
- link_used
- link_canceled
- link_expired
title: State
status:
Expand Down Expand Up @@ -13504,7 +13516,8 @@ components:
title: OneTimeConfirmSummary
description: |-
What the confirm page shows before the click. ``state`` is ``ok`` while the link can still be used,
else ``link_used`` or ``link_expired``. Reading it consumes nothing.
else ``link_used``, ``link_canceled`` (the order was canceled and its hold released) or
``link_expired``. Reading it consumes nothing.
OneTimeConfirmed:
properties:
order:
Expand Down Expand Up @@ -14063,9 +14076,9 @@ components:
``confirm`` (click the mailed link), ``wait`` (read again later) or ``done``. Money is integer
micro-USD. The field ``captured_micro`` is what the card was charged, written only once the payment
provider confirmed it. The field ``fax`` is the fax job once the order was released, with the
carrier's evidence once it has any. Three statuses come from a person at Fax for Agents: ``refunding``
(a refund is on its way to the card), ``refunded`` (the whole charge went back) and ``canceled`` (the
order was canceled and the hold on the card released, nothing charged).
carrier's evidence once it has any. Three statuses come from a person at Fax for Agents. With
``refunding`` a refund is on its way to the card, and with ``refunded`` the whole charge went back. With
``canceled`` the order was canceled and the hold on the card released, so nothing was charged.
OneTimeOrderCreated:
properties:
id:
Expand Down Expand Up @@ -16148,6 +16161,21 @@ components:
cancel_at_period_end:
type: boolean
title: Cancel At Period End
cancel_at:
anyOf:
- type: string
- type: 'null'
title: Cancel At
description: When Stripe is set to end the subscription. A cancel in the billing portal sets it to the
end of the period and leaves cancel_at_period_end false.
ends_at:
anyOf:
- type: string
- type: 'null'
title: Ends At
description: When the subscription ends without being charged again. That is cancel_at when it comes no
later than current_period_end, or current_period_end after a cancel at the period's end. Null while
it renews.
current_period_end:
anyOf:
- type: string
Expand Down Expand Up @@ -16176,6 +16204,8 @@ components:
- stripe_subscription_id
- stripe_price_id
- cancel_at_period_end
- cancel_at
- ends_at
- current_period_end
- entitled
- created_at
Expand Down
9 changes: 7 additions & 2 deletions scripts/curate.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ def insufficient_balance_schema(with_offer: bool, with_top_up: bool = False) ->

#: operationId -> status -> the description of an error the server answers there and does not declare in
#: its own document. Read from the server's routes and services (1.17.0). The codes are stable. Since 1.20.10
#: the server writes the 409 of rotate_api_key and cancel_topup_session itself, so neither is here.
#: the server writes the 409 of rotate_api_key and cancel_topup_session itself, so neither is here. The
#: ``link_canceled`` of confirm_one_time_order is read from ``onetime/release.py`` of 1.21.2.
DOCUMENTED_ERRORS: dict[str, dict[str, str]] = {
"create_fax": {
"402": (
Expand Down Expand Up @@ -616,7 +617,11 @@ def insufficient_balance_schema(with_offer: bool, with_top_up: bool = False) ->
},
"confirm_one_time_order": {
"404": "The confirmation link is not valid for this order (link_invalid).",
"409": "The link was already used (link_used), expired (link_expired), or the browser is signed in as someone else (link_other_session).",
"409": (
"The link was already used (link_used), its order was canceled and the hold released "
"(link_canceled), it expired (link_expired), or the browser is signed in as someone else "
"(link_other_session)."
),
},
"resend_one_time_confirmation": {
"409": "The order is not waiting for its confirmation (order_closed).",
Expand Down
2 changes: 1 addition & 1 deletion scripts/server-openapi.json

Large diffs are not rendered by default.

Loading