Docs

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
curl https://api.cartaflow.com.br/v1/balance \
  -H "Authorization: Bearer $CARTAFLOW_API_KEY"

Endpoints

EndpointWhat it does
POST/v1/lettersCreate a letter
GET/v1/letters/{letter_id}Retrieve a letter
GET/v1/lettersList letters
POST/v1/letters/{letter_id}/cancelCancel a letter
POST/v1/letters/quoteCalculate the price
POST/v1/uploadsCreate an upload
POST/v1/verificationsCreate a verification
GET/v1/verifications/{verification_id}Retrieve a verification
GET/v1/verificationsList verifications
POST/v1/verifications/{verification_id}/checkCheck a code
POST/v1/verifications/{verification_id}/cancelCancel or revoke a verification
GET/v1/postal-codes/{postal_code}Look up a postal code
GET/v1/accountRetrieve the account
GET/v1/balanceRetrieve the balance
GET/v1/balance/transactionsList balance transactions
GET/v1/eventsList events
GET/v1/events/{event_id}Retrieve an event
Webhookyour URLLetter events
Webhookyour URLVerification 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.

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.

On this page