Scannable Docs

Get the authenticated identity

Returns the organisation you act in, its type, and who you are: how you authenticated, the user you act as, and the roles or scopes your requests are judged against. Any API key with at least one scope can call this endpoint. Check roles (OAuth) or scopes (API key) to predict a 403.

GET
/v1/auth/me

Authorization

ApiKey
headerAuthorizationBearer <token>

Your organisation's API key. Send it as Authorization: Bearer <key>. Create one in the Scannable admin under Settings → API keys.

Response Body

Your organisation, its type, and your identity.

application/json
  1. response
organisation_id*string

Your organisation identifier, used to address it in the API (e.g. org_abc123).

type*string

What kind of organisation you act in. A manufacturer makes products and SKUs. An equipment_owner owns and inspects equipment.

Value in"manufacturer""equipment_owner"
manufacturer_id?string

Your manufacturer identifier, the brand your products and SKUs hang off (e.g. man_abc123). Only present when type is manufacturer.

member_id*|

Your identifier as a member of the organisation (e.g. member_abc123). For an API key it names the member who created the key, and is null once that member has left the organisation.

name*string

The display name of your organisation.

created_at*string

When your organisation was created (ISO 8601).

auth_method*string

How you authenticated. An api_key caller is judged by scopes. An oauth caller is judged by roles.

Value in"api_key""oauth"
user*|

The user you act as: the user who authorised your OAuth token. Null for an API key, which acts for your organisation rather than for the user who created it, so it keeps working after that user leaves.

roles*array<>

For an oauth caller, your roles in the organisation, which decide what you may do (for example ["admin"]). Empty for an API-key caller.

scopes*array<string>

For an API-key caller, the scopes your key grants (for example serials:read). On the manufacturer API, an API key with no scopes is a legacy key with full access. Empty for an oauth caller.

Example Request
curl -X GET 'https://api.scannable.io/v1/auth/me'
Example response
{  "organisation_id": "org_7h2k9m4p1q8r3s6",  "type": "manufacturer",  "manufacturer_id": "man_q4w7e2r9t5y1u3i",  "member_id": "member_3n8b5v2c7x4z1a9",  "name": "Summit Safety Ltd",  "created_at": "2024-05-13T08:00:00.000Z",  "auth_method": "api_key",  "user": {    "name": "Alex Morgan",    "email": "alex.morgan@summitsafety.example"  },  "roles": [    "admin"  ],  "scopes": [    "products:read",    "serials:write"  ]}