Errors
Every error code the API returns, and what to do about it.
Every error has the same shape:
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits.",
"details": { "required": 40, "available": 25 }
}
}codeis stable. Match on it, never onmessage. Two codes are lower case (insufficient_creditsandaccount_suspended) because they match what the Note Composer returns.messageis a sentence safe to show a person.detailsholds structured context for some codes, such as the suggested address for an address USPS doesn't confirm, ornull.
Each code always comes with the same HTTP status. Every 409 about the account's state can be checked first with GET /api/v1/account.
Retrying
429and503can be tried again later. When the answer carriesRetry-After, wait that many seconds first.- A
500can be tried again with the sameIdempotency-Key, so the note is never sent twice. - Other
4xxcodes need a change to the request or the account first.
Every code
This table is built from the OpenAPI document, so it always matches what the API returns.
| Status | Code | Meaning |
|---|---|---|
| 400 | CARD_BACK_NOT_AVAILABLE | card_back_id names a back for a postcard, or card backs are off for the account. Send card_back_id: null. |
| 400 | IDEMPOTENCY_KEY_REQUIRED | A send without an Idempotency-Key (a dry run needs none). |
| 400 | INVALID_ARGUMENT | A field or query parameter is missing, malformed or unknown. details names it when it can. |
| 400 | INVALID_COVER | card_image_key is not a key from GET /api/v1/covers: data for the library, or uploaded_covers for your own uploads. |
| 400 | INVALID_CURSOR | cursor is not a next_cursor from an earlier page. |
| 400 | INVALID_IDEMPOTENCY_KEY | The key is not 1 to 255 visible ASCII characters, or the header and idempotency_key differ. |
| 400 | MESSAGE_TOO_LONG | The message is over its format's limit, or over its letter design's max_chars. details.limit and details.length. |
| 400 | PRODUCT_UNAVAILABLE | The format is paused, or it is a letter and letters aren't on for the account (available: false in GET /api/v1/account), or it is flat and the organization doesn't have it. |
| 400 | WRITER_REQUIRED | The key's member has no handwriting of their own (an Operator only): send writer_id, a writer from GET /api/v1/writers. |
| 401 | API_KEY_EXPIRED | The key expired (details.expires_at). Make a new one in Settings. |
| 401 | API_KEY_NOT_LIVE | The key was revoked or expired, or you left its team, while the send ran. Nothing was charged. |
| 401 | API_KEY_REVOKED | The key was revoked, by you or an Org Admin, or you left its team. Make a new one in Settings. |
| 401 | INVALID_API_KEY | The key is malformed or unknown. |
| 401 | UNAUTHENTICATED | No Authorization header. |
| 402 | insufficient_credits | Not enough credits. details.required and details.available when known. |
| 402 | team_allocation_exceeded | The key's team reached its credit limit (its hard cap) for this period, though the organization may still have credits. Nothing was charged. An Org Admin raises it in Settings, Teams, or it resets at the start of the next month (UTC). |
| 403 | account_suspended | The account is suspended. |
| 403 | API_ACCESS_DISABLED | API access is turned off for the organization. |
| 403 | INSUFFICIENT_SCOPE | The key lacks the scope in details.required_scope. |
| 403 | TEAM_ROLE_REQUIRED | You are on the key's team but no longer a Writer or an Operator, so the key can't send. Nothing was charged. |
| 403 | WRITER_NOT_ALLOWED | writer_id names a teammate and the key's member isn't an Operator on the key's team. Nothing was charged. |
| 403 | WRITER_NOT_ON_TEAM | writer_id isn't a Writer on the key's team. GET /api/v1/writers lists them. Nothing was charged. |
| 404 | CARD_BACK_UNAVAILABLE | card_back_id isn't one of the account's team's card backs, or it was archived. |
| 404 | NOT_FOUND | No such note on the key's team (a cancel or a content delete: no such note of yours). |
| 409 | API_KEY_TEAM_MISMATCH | You now send for another team than the key's. Nothing was charged. Make a new key in Settings. |
| 409 | CARD_BACK_NOT_READY | The card back, or the account's default back, isn't rendered for print. Save it again in Card Backs, or send another card_back_id or null. |
| 409 | COVER_LIMIT_REACHED | The account's team keeps 100 uploaded covers, the most it can. Delete one in the Note Composer, then upload again. |
| 409 | DUPLICATE_NOTE | This recipient was sent this same message in the last 24 hours, by anyone on the team (details.reason same_message), or this crm_contact already has a live note going to print that day (same_crm_contact_day). Nothing was sent or charged. details.note_id is the earlier note. Set allow_duplicate: true to send it again on purpose. |
| 409 | HANDWRITING_NOT_READY | The account's handwriting font isn't built yet. |
| 409 | HANDWRITING_PROFILE_MISMATCH | handwriting_profile_id isn't the writer's current handwriting (the key's member's, or writer_id's). |
| 409 | NOTE_CONTENT_STILL_NEEDED | The note hasn't been mailed yet, so its content is still needed to print it. Delete it once it is mailed, or cancel it while it is queued. |
| 409 | NOTE_NOT_CANCELLABLE | The note can't be cancelled: the printer has started on it, it is no longer queued, or it was sent from a campaign. details.status is the note's status and details.reason says which. Nothing was changed or refunded. |
| 409 | RECIPIENT_ADDRESS_CHANGED | The recipient's address changed while the note was sent. Nothing was charged; send again. |
| 409 | RECIPIENT_EXISTS | Another request added this recipient a moment before. Nothing was charged; send again. |
| 409 | REFERRAL_LINK_UNAVAILABLE | The send asked for a referral QR code (cta.type: referral) and the account has no referral link. Leave out cta, or ask support. |
| 409 | RETURN_ADDRESS_MISSING | The account has no complete name and return address (only a postcard may leave it off). |
| 409 | TEAM_ARCHIVED | An Org Admin archived the key's team, so it sends nothing new. Nothing was charged. Make a key on another team in Settings. |
| 409 | WRITER_HAS_NO_HANDWRITING | The writer named by writer_id has no handwriting ready. Nothing was charged. |
| 413 | PAYLOAD_TOO_LARGE | The body is over 16 KB. |
| 415 | UNSUPPORTED_MEDIA_TYPE | The body was not sent as application/json. |
| 422 | ADDRESS_INVALID | USPS doesn't confirm the address. details.result, details.cause, and Google's details.suggestion (or null). |
| 422 | CUE_TOO_LONG_FOR_POSTCARD | The line beside the QR code doesn't fit the postcard. |
| 422 | IDEMPOTENCY_KEY_REUSED | This Idempotency-Key was used for a different request. Use a new key for each note, also when you send a cancelled note again. |
| 422 | IMAGE_NOT_ALLOWED | Screening refused the uploaded cover. Nothing was stored. |
| 422 | LETTER_DESIGN_NO_QR | The letter design has no place for a QR code (or for the account's footer line). Choose another design, or leave qr_url out. Nothing was charged. |
| 422 | LETTER_DESIGN_UNAVAILABLE | letter_design_id isn't a letter design this account can use. GET /api/v1/letter-designs lists them. |
| 422 | MESSAGE_DOES_NOT_FIT | The message doesn't fit the postcard, or a flat card's message would be written under its smallest letter size (details.reason is below_floor, with details.over_by, about how many characters to cut, details.x_height_mm and details.floor_x_height_mm; nothing was charged), or a letter would be written under its design's smallest letter size (details.reason is below_floor, with details.x_height_mm, details.floor_x_height_mm and details.lines), or a letter has a closing and no message (no_body), or the account's footer line doesn't fit beside the QR code (details.part is footer, with details.x_height_mm and details.floor_x_height_mm; nothing was charged). |
| 422 | NO_FONT | The handwriting cannot draw a postcard or a flat card yet. Finish it in My Handwriting, then send. |
| 422 | QR_LINK_REDIRECTS | cta.url passes the visitor on to another address (an open redirect). Link to the page itself. Nothing was charged. |
| 422 | QR_SITE_BLOCKED | Stylograph turned cta.url's site off, or Google lists the link as unsafe. Nothing was charged. |
| 422 | QR_SITE_NOT_LISTED | cta.url's site isn't one of the account's QR code sites. Add it in the Note Composer (Settings > QR code sites), then send. Nothing was charged. |
| 422 | QR_SITE_PENDING | cta.url's site is waiting for Stylograph's review. Send once it's approved. Nothing was charged. |
| 422 | QR_URL_NOT_ALLOWED | qr_url isn't a link this account can print: it must be an https link of at most 120 characters on a site enabled for the account. The answer is the same for a wrong shape, a site off the list, and an account with no list. |
| 422 | RECIPIENT_INCOMPLETE | The recipient has no name, street, city, state or ZIP. |
| 422 | RECIPIENT_NOT_DRAWABLE | The recipient's name or address has characters the handwriting cannot write. |
| 422 | RECIPIENT_NOT_FOUND | recipient_id is not in your address book. |
| 422 | RECIPIENT_TOO_LONG_FOR_POSTCARD | The recipient's address doesn't fit a postcard. |
| 422 | RETURN_ADDRESS_NOT_DRAWABLE | The name or return address has characters the handwriting cannot write. |
| 422 | RETURN_ADDRESS_TOO_LONG_FOR_POSTCARD | The return address doesn't fit the postcard. |
| 422 | UNSUPPORTED_CHARACTERS | Characters the handwriting cannot write: details.missing_characters (capture them) and details.unsupported_characters (remove them). |
| 429 | ACCOUNT_PRINT_SHARE_REACHED | Your account's share of printing capacity for the note's print day is used. Nothing was charged. Send it for a later day with scheduled_for, or try again after Retry-After. |
| 429 | ADDRESS_CHECK_RATE_LIMITED | The account checked 60 addresses in the last hour. Wait Retry-After seconds. |
| 429 | API_DAILY_LIMIT_REACHED | The organization sent its API notes for the last 24 hours. A cancelled note counts only past as many cancelled notes as the limit. details.daily_limit, details.next_slot_at, and Retry-After. |
| 429 | API_KEY_DAILY_LIMIT_REACHED | This key sent the notes its own daily cap allows for the last 24 hours. A cancelled note counts only past as many cancelled notes as the cap. details.daily_limit, details.next_slot_at, and Retry-After. |
| 429 | IMAGE_SCREENING_RATE_LIMITED | The account uploaded 30 images in the last hour. Nothing was stored. Wait Retry-After seconds. |
| 429 | RATE_LIMITED | Over 60 requests a minute for the organization. Wait Retry-After seconds. |
| 429 | RECIPIENT_DAILY_LIMIT_REACHED | Your team added 1000 recipients in the last 24 hours, the most the API adds in a day. Nothing was added. |
| 429 | RECIPIENT_EDIT_LIMIT_REACHED | Your team changed 200 addresses through the API in the last 24 hours, the most the API changes in a day. Nothing was changed. A name or company edit doesn't count. |
| 500 | INTERNAL | Something went wrong on our side. Try again. |
| 503 | ADDRESS_CHECK_UNAVAILABLE | The address couldn't be checked just now. Nothing was charged. Try again after Retry-After. |
| 503 | FLAT_NOTECARD_CHECK_UNAVAILABLE | The check that a flat card's message fits its back couldn't run. Nothing was sent or charged. Retry after Retry-After. |
| 503 | LETTER_CHECK_UNAVAILABLE | The check that a letter fits its page couldn't run. Nothing was sent or charged. Retry after Retry-After. |
| 503 | POSTCARD_CHECK_UNAVAILABLE | The postcard's fit couldn't be checked just now. Nothing was charged. |
| 503 | VENDOR_DAILY_CEILING_REACHED | Printing capacity for the note's print day is full. Nothing was charged. Send it for a later day with scheduled_for, or try again after Retry-After. |