Stylograph API

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 }
  }
}
  • code is stable. Match on it, never on message. Two codes are lower case (insufficient_credits and account_suspended) because they match what the Note Composer returns.
  • message is a sentence safe to show a person.
  • details holds structured context for some codes, such as the suggested address for an address USPS doesn't confirm, or null.

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

  • 429 and 503 can be tried again later. When the answer carries Retry-After, wait that many seconds first.
  • A 500 can be tried again with the same Idempotency-Key, so the note is never sent twice.
  • Other 4xx codes 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.

StatusCodeMeaning
400CARD_BACK_NOT_AVAILABLEcard_back_id names a back for a postcard, or card backs are off for the account. Send card_back_id: null.
400IDEMPOTENCY_KEY_REQUIREDA send without an Idempotency-Key (a dry run needs none).
400INVALID_ARGUMENTA field or query parameter is missing, malformed or unknown. details names it when it can.
400INVALID_COVERcard_image_key is not a key from GET /api/v1/covers: data for the library, or uploaded_covers for your own uploads.
400INVALID_CURSORcursor is not a next_cursor from an earlier page.
400INVALID_IDEMPOTENCY_KEYThe key is not 1 to 255 visible ASCII characters, or the header and idempotency_key differ.
400MESSAGE_TOO_LONGThe message is over its format's limit, or over its letter design's max_chars. details.limit and details.length.
400PRODUCT_UNAVAILABLEThe 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.
400WRITER_REQUIREDThe key's member has no handwriting of their own (an Operator only): send writer_id, a writer from GET /api/v1/writers.
401API_KEY_EXPIREDThe key expired (details.expires_at). Make a new one in Settings.
401API_KEY_NOT_LIVEThe key was revoked or expired, or you left its team, while the send ran. Nothing was charged.
401API_KEY_REVOKEDThe key was revoked, by you or an Org Admin, or you left its team. Make a new one in Settings.
401INVALID_API_KEYThe key is malformed or unknown.
401UNAUTHENTICATEDNo Authorization header.
402insufficient_creditsNot enough credits. details.required and details.available when known.
402team_allocation_exceededThe 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).
403account_suspendedThe account is suspended.
403API_ACCESS_DISABLEDAPI access is turned off for the organization.
403INSUFFICIENT_SCOPEThe key lacks the scope in details.required_scope.
403TEAM_ROLE_REQUIREDYou are on the key's team but no longer a Writer or an Operator, so the key can't send. Nothing was charged.
403WRITER_NOT_ALLOWEDwriter_id names a teammate and the key's member isn't an Operator on the key's team. Nothing was charged.
403WRITER_NOT_ON_TEAMwriter_id isn't a Writer on the key's team. GET /api/v1/writers lists them. Nothing was charged.
404CARD_BACK_UNAVAILABLEcard_back_id isn't one of the account's team's card backs, or it was archived.
404NOT_FOUNDNo such note on the key's team (a cancel or a content delete: no such note of yours).
409API_KEY_TEAM_MISMATCHYou now send for another team than the key's. Nothing was charged. Make a new key in Settings.
409CARD_BACK_NOT_READYThe 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.
409COVER_LIMIT_REACHEDThe account's team keeps 100 uploaded covers, the most it can. Delete one in the Note Composer, then upload again.
409DUPLICATE_NOTEThis 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.
409HANDWRITING_NOT_READYThe account's handwriting font isn't built yet.
409HANDWRITING_PROFILE_MISMATCHhandwriting_profile_id isn't the writer's current handwriting (the key's member's, or writer_id's).
409NOTE_CONTENT_STILL_NEEDEDThe 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.
409NOTE_NOT_CANCELLABLEThe 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.
409RECIPIENT_ADDRESS_CHANGEDThe recipient's address changed while the note was sent. Nothing was charged; send again.
409RECIPIENT_EXISTSAnother request added this recipient a moment before. Nothing was charged; send again.
409REFERRAL_LINK_UNAVAILABLEThe send asked for a referral QR code (cta.type: referral) and the account has no referral link. Leave out cta, or ask support.
409RETURN_ADDRESS_MISSINGThe account has no complete name and return address (only a postcard may leave it off).
409TEAM_ARCHIVEDAn Org Admin archived the key's team, so it sends nothing new. Nothing was charged. Make a key on another team in Settings.
409WRITER_HAS_NO_HANDWRITINGThe writer named by writer_id has no handwriting ready. Nothing was charged.
413PAYLOAD_TOO_LARGEThe body is over 16 KB.
415UNSUPPORTED_MEDIA_TYPEThe body was not sent as application/json.
422ADDRESS_INVALIDUSPS doesn't confirm the address. details.result, details.cause, and Google's details.suggestion (or null).
422CUE_TOO_LONG_FOR_POSTCARDThe line beside the QR code doesn't fit the postcard.
422IDEMPOTENCY_KEY_REUSEDThis Idempotency-Key was used for a different request. Use a new key for each note, also when you send a cancelled note again.
422IMAGE_NOT_ALLOWEDScreening refused the uploaded cover. Nothing was stored.
422LETTER_DESIGN_NO_QRThe 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.
422LETTER_DESIGN_UNAVAILABLEletter_design_id isn't a letter design this account can use. GET /api/v1/letter-designs lists them.
422MESSAGE_DOES_NOT_FITThe 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).
422NO_FONTThe handwriting cannot draw a postcard or a flat card yet. Finish it in My Handwriting, then send.
422QR_LINK_REDIRECTScta.url passes the visitor on to another address (an open redirect). Link to the page itself. Nothing was charged.
422QR_SITE_BLOCKEDStylograph turned cta.url's site off, or Google lists the link as unsafe. Nothing was charged.
422QR_SITE_NOT_LISTEDcta.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.
422QR_SITE_PENDINGcta.url's site is waiting for Stylograph's review. Send once it's approved. Nothing was charged.
422QR_URL_NOT_ALLOWEDqr_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.
422RECIPIENT_INCOMPLETEThe recipient has no name, street, city, state or ZIP.
422RECIPIENT_NOT_DRAWABLEThe recipient's name or address has characters the handwriting cannot write.
422RECIPIENT_NOT_FOUNDrecipient_id is not in your address book.
422RECIPIENT_TOO_LONG_FOR_POSTCARDThe recipient's address doesn't fit a postcard.
422RETURN_ADDRESS_NOT_DRAWABLEThe name or return address has characters the handwriting cannot write.
422RETURN_ADDRESS_TOO_LONG_FOR_POSTCARDThe return address doesn't fit the postcard.
422UNSUPPORTED_CHARACTERSCharacters the handwriting cannot write: details.missing_characters (capture them) and details.unsupported_characters (remove them).
429ACCOUNT_PRINT_SHARE_REACHEDYour 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.
429ADDRESS_CHECK_RATE_LIMITEDThe account checked 60 addresses in the last hour. Wait Retry-After seconds.
429API_DAILY_LIMIT_REACHEDThe 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.
429API_KEY_DAILY_LIMIT_REACHEDThis 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.
429IMAGE_SCREENING_RATE_LIMITEDThe account uploaded 30 images in the last hour. Nothing was stored. Wait Retry-After seconds.
429RATE_LIMITEDOver 60 requests a minute for the organization. Wait Retry-After seconds.
429RECIPIENT_DAILY_LIMIT_REACHEDYour team added 1000 recipients in the last 24 hours, the most the API adds in a day. Nothing was added.
429RECIPIENT_EDIT_LIMIT_REACHEDYour 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.
500INTERNALSomething went wrong on our side. Try again.
503ADDRESS_CHECK_UNAVAILABLEThe address couldn't be checked just now. Nothing was charged. Try again after Retry-After.
503FLAT_NOTECARD_CHECK_UNAVAILABLEThe check that a flat card's message fits its back couldn't run. Nothing was sent or charged. Retry after Retry-After.
503LETTER_CHECK_UNAVAILABLEThe check that a letter fits its page couldn't run. Nothing was sent or charged. Retry after Retry-After.
503POSTCARD_CHECK_UNAVAILABLEThe postcard's fit couldn't be checked just now. Nothing was charged.
503VENDOR_DAILY_CEILING_REACHEDPrinting 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.

On this page