Overview
Every endpoint and webhook of the CartaFlow API, with each field, value and error.
The reference covers every endpoint of the API: its parameters, the request body field by field, the responses and the possible errors, with examples in several languages. To learn the concepts first, start with the Guides.
Base URL and authentication
Every request goes to https://api.cartaflow.com.br/v1 and carries the API key, which starts with cf_live_, in the Authorization: Bearer header. Create keys in the dashboard, under Desenvolvedores > Chaves de API (Developers > API keys), and call the API only from your server. See Authentication.
curl https://api.cartaflow.com.br/v1/balance \
-H "Authorization: Bearer $CARTAFLOW_API_KEY"Endpoints
| Endpoint | What it does |
|---|---|
POST/v1/letters | Create a letter |
GET/v1/letters/{letter_id} | Retrieve a letter |
GET/v1/letters | List letters |
POST/v1/letters/{letter_id}/cancel | Cancel a letter |
POST/v1/letters/quote | Calculate the price |
POST/v1/uploads | Create an upload |
POST/v1/verifications | Create a verification |
GET/v1/verifications/{verification_id} | Retrieve a verification |
GET/v1/verifications | List verifications |
POST/v1/verifications/{verification_id}/check | Check a code |
POST/v1/verifications/{verification_id}/cancel | Cancel or revoke a verification |
GET/v1/postal-codes/{postal_code} | Look up a postal code |
GET/v1/account | Retrieve the account |
GET/v1/balance | Retrieve the balance |
GET/v1/balance/transactions | List balance transactions |
GET/v1/events | List events |
GET/v1/events/{event_id} | Retrieve an event |
Webhookyour URL | Letter events |
Webhookyour URL | Verification events |
Download the OpenAPI specification
The API is described in OpenAPI 3.1. Import the file into Postman or Insomnia to build the calls, or feed it to a code generator to build a client in your language.
- OpenAPI in English: descriptions in English.
- OpenAPI in Portuguese: descriptions in Portuguese.
Both files describe exactly the same API. Only the description text differs.
Before you start
- Conventions: IDs, dates, amounts in centavos, headers and HTTP statuses.
- Errors: the shape of every error response and the meaning of each code.
- Idempotency: how to retry a request without creating anything twice.