Scheduling
Create a letter today and choose the day it is charged and sent to production.
With the send_date field you create a letter now and choose the date it goes into production. Use it for appointment reminders, renewals, birthdays and any mailing that already has a date.
How it works
You create the letter with send_date
The API validates everything right away: the address, the document and the printing options. If something is wrong, the 422 response lists the problems and nothing is created. If everything is fine, the letter starts with status scheduled.
Nothing is charged until the date
The balance does not need to cover the price at creation. The letter stays scheduled, and you can cancel it at no cost.
On the send date, CartaFlow charges the balance
If the balance covers the price, the amount is debited and the letter moves to received. From there it follows the same path as any letter: in_production, printed and posted.
If the balance does not cover the price, the letter moves to canceled, with cancellation_reason: insufficient_balance. Nothing is charged.
Schedule a letter
Send the same body as Create a letter, plus send_date formatted as YYYY-MM-DD. Both request formats work: JSON, as below, or the PDF uploaded as a file in multipart/form-data, with send_date as one more form part. See Document and address area.
curl -X POST "https://api.cartaflow.com.br/v1/letters" \
-H "Authorization: Bearer $CARTAFLOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: lembrete-revisao-2291" \
-d '{
"to": {
"name": "Destinatário Exemplo",
"postal_code": "01001-000",
"number": "128",
"complement": "Ap. 52"
},
"document": {
"type": "url",
"url": "https://arquivos.exemplo.com.br/lembretes/revisao-2291.pdf"
},
"send_date": "2026-10-20",
"reference": "lembrete-revisao-2291"
}'The response is a letter with status: scheduled, send_date: "2026-10-20" and received_at: null. The price field already shows the price on today’s plan.
send_date rules
- Format
YYYY-MM-DD, date only. You do not pick a time: the charge happens at 06:00 Brasília time (time zoneAmerica/Sao_Paulo) on that day. - The date can be from tomorrow up to 180 days ahead. A date outside that range gets a 422, with the problem pointed at
send_date. - To send right away, leave the field out. There is no scheduling for today.
- The date cannot change after creation. To pick another day, cancel and create the letter again.
What CartaFlow checks at creation and on the date
| At creation | On the send date | |
|---|---|---|
| Address and document | Validated. The PDF is stored exactly as it will be printed. | Nothing changes. The PDF is not downloaded again: changing the file at the URL after creation does not affect the letter. |
| Balance | Does not need to cover the price. | Must cover the price, or the letter is canceled. |
| Price | Calculated on today’s plan, in price. | Calculated again on the account’s plan that day, and charged. |
Cancel a scheduled letter
While the letter is scheduled, cancel it with POST /v1/letters/{letter_id}/cancel. Nothing was charged, so there is no refund. The letter moves to canceled with cancellation_reason: requested. See Letters and statuses.
Change a scheduled letter
Through the API, a letter does not change after it is created: to change something, cancel it (free while it is scheduled) and create another. In the dashboard, under Envios (Letters), a scheduled letter can change its date, address, file, variables, printing, Correios services and reference at no cost, or be sent right away, which charges it. See Letters and statuses.
Events
A scheduled letter produces these events, in order:
letter.scheduledat creation.letter.updatedevery time it is changed in the dashboard before its date, with the letter as it is now (the newsend_date, for example).letter.receivedon the send date, after the charge, or when it is sent right away from the dashboard. Orletter.canceledwithcancellation_reason: insufficient_balance, if the balance did not cover the price on the date.letter.in_production,letter.printedandletter.posted, as for any letter.
Good practice
- Keep the balance topped up. Before a date with many mailings, add up the prices of the scheduled letters and check the balance with GET /v1/balance.
- Listen to
letter.canceled. When the reason isinsufficient_balance, alert your team, or top up the balance and create the letter again. - List what is scheduled with GET /v1/letters?status=scheduled. Combine it with
created_afterandcreated_beforeto see a period.
The balance is not reserved
Scheduling does not set money aside. On the date, each letter is charged against the balance available at that moment.