Skip to content
Documentation menu

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.

ScopeGrants access toCreator’s minimum role
short_links:readRead short links.Viewer
short_links:writeCreate, update and delete short links; includes short_links:read.Editor
qr_codes:readRead and export QR codes.Viewer
qr_codes:writeCreate and update QR codes (no deletion); includes qr_codes:read.Editor
link_pages:readRead link pages and their links.Viewer
link_pages:writeCreate and update link pages and their links, delete links (no page deletion); includes link_pages:read.Editor
analytics:readRead analytics.Viewer
webhooks:manageManage 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 write scope (for example after its creator was demoted).
  • The webhooks:manage scope 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.

Read next