Authentication
Bearer tokens, scopes, roles, expiry and security best practices.
Bearer token#
Every request carries a personal token in the Authorization header: Authorization: Bearer hyl_….
A token starts with hyl_ and ends with a checksum: a malformed token is refused right away. After creation, the app only shows its start (the prefix), never its value.
A missing, unknown, expired or revoked token answers 401 invalid_token.
Workspace#
A token belongs to a single workspace, the one where it was created. Every route reads and writes in that workspace; GET /me tells you which one.
The app’s X-Workspace header does not exist here: if you send it, it is ignored.
A resource from another workspace answers 404, as if it did not exist: the API never reveals that a resource exists outside the token’s workspace.
Scopes#
A token only carries the scopes chosen when it was created, by family, for reading and writing. A write scope also grants the read of its family: the token stores both and GET /me lists them.
| Scope | Grants access to | Creator’s minimum role |
|---|---|---|
short_links:read | Read short links. | Viewer |
short_links:write | Create, update and delete short links; includes short_links:read. | Editor |
qr_codes:read | Read and export QR codes. | Viewer |
qr_codes:write | Create and update QR codes (no deletion); includes qr_codes:read. | Editor |
link_pages:read | Read link pages and their links. | Viewer |
link_pages:write | Create and update link pages and their links, delete links (no page deletion); includes link_pages:read. | Editor |
analytics:read | Read analytics. | Viewer |
webhooks:manage | Manage the workspace’s webhooks (no write variant). | Admin |
The scope required by each operation is shown in the reference. GET /me requires none.
A missing scope answers 403 insufficient_scope, with the required_scope field. This check comes before the check that the resource exists: see Order of checks.
Roles#
A token acts with its creator’s rights in the workspace. That role is read again on every request, it is not frozen at creation.
- A viewer can only read: every write answers 403, even if the token carries a
writescope (for example after its creator was demoted). - The
webhooks:managescope is only granted to a workspace admin. - The access offered at creation depends on your role in the workspace: choices that exceed it are unavailable.
The plan’s rights apply too: see Plan-dependent features.
Expiry and revocation#
At creation, the expiry is 30, 90 or 365 days, or none. An expired token answers 401 invalid_token; the app warns you before the deadline. A member can have at most 50 active tokens.
- Revoke: in Settings, API, Revoke action. Calls are refused immediately, permanently. An admin can also revoke other members’ tokens.
- Member removed: if the creator leaves the workspace or is removed from it, their token answers 401
invalid_token. - Plan downgrade: if the workspace’s plan no longer includes the API, requests answer 402. The token is kept, listed and revocable; it works again if the plan comes back.
Security#
- Keep the token on the server or in a secrets manager: never in a web page, a mobile app or a code repository.
- The API has no CORS: a browser cannot call it from a page, on purpose. Call it from a server.
- One token per integration, with the minimum scopes and an expiry.
- Every token creation is reported to all the workspace’s admins, in the app and by email.
- In case of a leak, revoke the token in Settings, API, then create another one.
Repeated authentication refusals from the same IP address are limited: see Failed authentication.
