Skip to content

Authentication

A request to the Shypr API authenticates with an API key. A key belongs to one workspace and to the member who made it.

Send the key in the X-API-KEY header:

POST /graphql HTTP/1.1
Host: api.shypr.app
X-API-KEY: sh_...
Content-Type: application/json

Or send it as a bearer token:

Authorization: Bearer sh_...

Both forms do the same thing. Shypr reads a bearer token as an API key only when it starts with sh_.

A request with an API key has no session and sets no cookie.

Scope Can read Can write
read_only Yes No
read_write Yes Yes

A read_only key that calls a REST write or a GraphQL mutation gets 403 Forbidden with this detail:

This API key does not have write permissions. Use a read_write scoped key for this operation.

Give each integration the smallest scope it needs. A reporting tool needs only read_only.

Each key has an expiry date, at most one year after the day you make it. After that date the key stops working and the API answers 401 Unauthorized. Make a new key before the old one expires, and then delete the old key.

Shypr records when a key was last used. You see it in Settings → API keys.

A key acts as the member who made it, in the workspace of the key. The role of that member (manager or admin) sets what the key can do. The key stops working when that member leaves the workspace or an admin disables the member.

Status Cause
401 Unauthorized The key is unknown or expired, or its member no longer belongs to the workspace.
403 Forbidden The key is read_only and the request writes, or the member has no right to the operation.