Stylograph API

Authentication

API keys, scopes and how to keep a key safe.

Every request carries an API key as a bearer token:

Authorization: Bearer sg_live_...

A missing, revoked or expired key answers 401. A key without the scope a route needs answers 403.

Making a key

Keys are made in the Note Composer under Settings, in the API keys section, once API access is on for your organization. The key works on the team you are acting as when you make it, and only on that team. You need a role other than Viewer, and you need to have signed in within the last 30 minutes. You get an email about every new key.

  • The key is shown once, when you make it. Store it then. Stylograph keeps only a hash of it and its first 8 characters, which Settings shows so you can tell keys apart.
  • A key expires after 30, 90 or 365 days. You pick when you make it, and 90 is the default.
  • Each member can hold up to 10 live keys and make up to 20 new keys in 24 hours. An organization holds at most 50 live keys across its members.
  • A key that can send may carry its own daily note cap, from 1 to 1000 notes in 24 hours. You set it when you make the key, and it can't be changed after. The organization's own limit still applies on top of it. Past the cap, a send answers 429 API_KEY_DAILY_LIMIT_REACHED.
  • Revoke a key in Settings and it stops working at once. An Org Admin can revoke any key in the organization.
  • A key whose member leaves its team stops working.

Scopes

A key holds only the scopes it was made with. A new key starts with account:read and notes:read, so it can read but not send.

ScopeWhat it opens
account:readGET /api/v1/account
notes:readGET /api/v1/notes and GET /api/v1/notes/{noteId}
notes:sendSending (POST /api/v1/notes), uploading a cover (POST /api/v1/covers), cancelling a note (DELETE /api/v1/notes and DELETE /api/v1/notes/{noteId}), deleting a mailed note's content (DELETE /api/v1/notes/{noteId}/content), and reading recipients, card backs, writers, letter designs and templates
recipients:writeA send to a new recipient, who is then added to your address book. With a role that can change recipients, it also adds, edits and imports recipients. See Recipients.

Any live key can read GET /api/v1/covers.

Give each system the smallest set it needs, and its own key, so you can revoke one without stopping the others. A dashboard that only shows delivery status needs notes:read and nothing else. An AI agent needs account:read, notes:read and notes:send, without recipients:write, so it can send only to people already in your address book. Give it a low daily cap too. A system that keeps your address book, such as a CRM sync, gets its own key with recipients:write.

Keeping a key safe

  • Call the API from your server. The API sends no CORS headers, so a browser can't call it, and a key in a web page or a mobile app is a key anyone can copy.
  • Keep keys in a secret store or an environment variable, never in source control.
  • If a key leaks, revoke it in Settings and make a new one.

On this page