Stylograph API

Recipients

Search the address book, add and edit people, and import a list.

A note goes to someone in your team's address book, named by recipient_id, or to a new person sent inline as recipient. These routes let a system keep the address book itself, so a later send only needs the id.

Searching

GET /api/v1/recipients?q= finds people by name or company. It needs the notes:send scope. See Sending a note for how a search matches.

A match shows the names, company, city and state, and address_complete. It never shows the street lines or ZIP.

Who can change the address book

Adding, editing and importing need two things:

  • A key with the recipients:write scope. A new key doesn't have it, so make a separate key for the system that keeps your address book.
  • A role on the key's team that can change recipients: Org Admin, Team Admin or Operator. The role is read on every call, so a member whose role changes loses the right at once. Without it, a call answers 403 TEAM_ROLE_REQUIRED.

A team adds at most 1000 new recipients through the API in any 24 hours, counting every route that adds one. Past it, a call answers 429 RECIPIENT_DAILY_LIMIT_REACHED and adds nobody. For a bigger list, import a CSV in the Note Composer.

Adding a recipient

POST /api/v1/recipients adds one person without mailing them. Nothing is charged.

curl https://composer.stylograph.ai/api/v1/recipients \
  -H "Authorization: Bearer $STYLOGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Ada",
    "last_name": "Lovelace",
    "company": "Analytical Engines",
    "address_line1": "12 St James Square",
    "city": "Boston",
    "state": "MA",
    "zip": "02108"
  }'

The fields are the ones an envelope shows: honorific, first_name, last_name, company, address_line1, address_line2, city, state and zip. A name and a full address are required.

  • A new person answers 201 with created: true and the recipient in data.
  • Someone already in the address book with the same name and address, ignoring case, answers 200 with created: false and that entry. Nobody is added twice, so a retry is safe.
  • The address isn't checked here. The send checks it with USPS, as it does for anyone.

Editing a recipient

PATCH /api/v1/recipients/{recipientId} changes only the fields you send.

curl -X PATCH https://composer.stylograph.ai/api/v1/recipients/RECIPIENT_ID \
  -H "Authorization: Bearer $STYLOGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "address_line1": "14 St James Square" }'
  • A required field can't be blanked. That answers 400 INVALID_ARGUMENT.
  • A change to the address means the next note to them checks the new address. A note already sent keeps the address it was sent with.
  • A team changes at most 200 addresses through the API in any 24 hours. Past it, an edit answers 429 RECIPIENT_EDIT_LIMIT_REACHED and changes nothing. Name changes don't count. Stylograph keeps the old address of every edit, so a wrong change can be undone.
  • An edit that would make the entry the same as another one in the address book answers 409 RECIPIENT_EXISTS and changes nothing.
  • An archived recipient, one on another team and an unknown id all answer 404 NOT_FOUND.

Importing a list

POST /api/v1/recipients/import adds up to 500 rows in one call, from a spreadsheet, a CRM export or an event's attendee list. Each row takes the same fields as adding one person.

curl https://composer.stylograph.ai/api/v1/recipients/import \
  -H "Authorization: Bearer $STYLOGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dry_run": true,
    "rows": [
      { "first_name": "Ada", "last_name": "Lovelace", "address_line1": "12 St James Square", "city": "Boston", "state": "MA", "zip": "02108" },
      { "first_name": "Charles", "last_name": "Babbage", "address_line1": "1 Dorset Street", "city": "Boston", "state": "MA", "zip": "02127" }
    ]
  }'

The answer:

{
  "data": {
    "dry_run": true,
    "added": 2,
    "existing": 0,
    "skipped": [],
    "recipient_ids": []
  }
}
  • An import only adds. Someone already in the address book is counted in existing and left unchanged. To change an entry, edit it.
  • A row missing a name or a full address is skipped and listed in skipped with its row number and what was wrong.
  • The rest go in together or not at all. A batch that would go past the team's daily limit adds nobody.
  • With dry_run: true, nothing is added and recipient_ids is empty. Run a dry run first and check the counts.
  • A real import answers 201 when it added someone, and 200 when everyone was already there. recipient_ids lists the ids to send to.
  • The request body may be up to 256 KB.

From an agent

The MCP server has the same three as tools: add_recipient, update_recipient and import_recipients. They need the same scope and role. An agent should show the person what it is about to add or change, and run import_recipients with dry_run first.

On this page