Authentication
The developer API uses bearer tokens. You create a token once from your dashboard, then send it on every request.
Generate a token
Section titled “Generate a token”- Sign in to your dashboard and go to Settings → Developer (
/settings/developer). - Click Create token, give it a name so you can recognize it later, and select its scopes.
- Copy the generated token immediately — it is shown only once. Only a short hint (its leading characters) is stored afterward, so the full value can never be retrieved again.
Token format
Section titled “Token format”Every token starts with a short platform prefix, followed by 40 random characters:
acme_nUq7Y…40 characters…0fA2The prefix lets secret scanners (e.g. GitHub) flag the credential if it is ever leaked.
Use the token
Section titled “Use the token”Send the token in the Authorization header as a bearer token:
curl https://api.prettycode.dev/v1/me \ -H "Authorization: Bearer YOUR_TOKEN"Scopes
Section titled “Scopes”A token is granted one or more scopes, and each endpoint requires a specific scope.
| Scope | Grants |
|---|---|
read_user | Read the authenticated user’s profile (GET /v1/me). |
render_snippets | Turn code into images (POST /v1/renders). |
write_snippets | Save snippets, folders and tags in your library — needed with render_snippets when a render has save. |
read_presets | List your organization’s style presets (GET /v1/presets). |
Snippets and style presets the API reads or saves live in your organization’s default workspace (its oldest one), whichever workspace you have open in the app.
A request made with a token that lacks the required scope returns 403 Forbidden.
Rate limits
Section titled “Rate limits”Requests are limited per minute for your whole organization (120 by default), not per token — another token doesn’t add to the limit. Going over it returns 429 Too Many Requests with a Retry-After header. See Rate limits.
Revoke a token
Section titled “Revoke a token”Revoke a token at any time from Settings → Developer. Revoked tokens are rejected immediately.