Courio
Get a quote

Letter sending API for developers

A customer of your billing software, CRM or property management tool asks to send a paper letter from inside it. Integrating with a printer and contracting a postal provider is a bigger job than the feature itself. The Courio API covers it with a few HTTP calls, and a letter that comes back shows up as a returned status.

The two-call flow

POST /v1/letters/quote takes the service you want (standard, tracked, registered or registered_ar), the sender and recipient addresses and the document. The document is a base64 PDF (pdf_base64), a link to one (pdf_url) or plain text or Markdown. The response holds a quote_id, the price, the postal product used for the destination (legal_product) and a delivery estimate. A quote costs nothing and commits you to nothing.

POST /v1/letters turns the quote into a letter and returns a letter_id with a payment link. Once payment is made, the letter is printed and posted. A quote works once: asking again with a different Idempotency-Key for the same quote_id returns quote_already_used, which names the existing letter.

Contract and errors

The OpenAPI document describes every field and error, and the agents page gathers the curl examples, the statuses and the rules of use. Requested services are generic levels. Courio maps each to the destination’s own product, such as a registered letter or an Einschreiben, and returns the exact name in the quote. You do not need to place the address for an envelope window, because an address page is added when needed.

Content is screened before a quote is issued, so a content_rejected error is final for that letter. Do not retry it unchanged.

Limits to plan for

Call GET /v1/coverage before you quote, so your code can pick a service level the destination has. Daily caps apply per IP address, sender email and API key, and hitting one returns 429 limit_exceeded with a retry_after. Wait that long and retry with the same Idempotency-Key, and keep the quote_id you hold for as long as it is valid, not a fresh quote per attempt. The agents page lists the file and page limits.

Following a letter from your app

A letter moves from awaiting payment to paid, submitted, in transit and delivered. It can also end as returned or failed, or expire if never paid. Store the letter_id in your database and choose between polling and the webhook. Proof links for the services that carry one are signed and short lived: fetch the letter again to get fresh ones.

Where a person stays in the loop

Payment does not happen on its own. Your own app should show the price, the recipient and the document before it creates the letter, because the Stripe page shows the amount and the service, not the recipient or the document. Put that confirmation step ahead of the creation call.

If an assistant drives the flow instead of your code, postal mail for AI agents describes the MCP server and the agent rules. For a human who needs no code at all, send occasional business mail is the shorter path.

Questions

Do I need an API key to start?

No. Calls work without an account or a key. An optional key sent as Authorization: Bearer ck_... attaches letters to it, gives the full view of them and has its own daily limit. A malformed or unknown key gets a 401, while no key at all is accepted.

What happens if my code retries a request after a network failure?

Every POST needs an Idempotency-Key header. Replaying the same request with the same key returns the stored result instead of creating a second object. The same key with a different body returns idempotency_key_reused.

How does my app learn that a letter has moved on?

Poll GET /v1/letters/{id}, or pass an https webhook_url when you create the letter. Each status change is POSTed to it with a Courio-Signature header, which you verify with the webhook_secret returned once in the creation response. Failed deliveries are retried with backoff for 24 hours, and the payload carries an event_id to deduplicate on.

Can the errors be handled in code?

Yes. They are application/problem+json with a stable code and a one-sentence hint that says what to do next. A 5xx or a dropped connection is safe to retry with the same idempotency key.

Can my service pay without a human?

By default creating a letter returns a Stripe payment link for a person to open. Autonomous agents can pay over REST with MPP or x402 where a deployment enables them; postal mail for AI agents covers that.