Cubicle

Get the caller

GET
/v1/me

Returns who the bearer token belongs to and the organizations it can use. API keys of either scope and sign-in sessions may call this route.

  • With an API key, id and identity are the key's service account (acme/ci), orgs holds only the key's organization, and apiKey gives the key's ID, organization and scope.
  • With a sign-in session, orgs includes the person's personal organization (personal: true), and apiKey is absent.

See Organizations and access.

Authorization

headerAuthorizationBearer <token>

A service account API key (cbk_…), used directly as the bearer token. read keys may call only GET routes.

Response Body

The caller. The example is for an API key.

application/json
  1. response
id*string

The signed-in user's ID, or the ID of the service account that owns the API key.

identity*string

The user's sign-in identity, usually an email address, or ORG/NAME for a service account.

operator?boolean

Whether the caller is a Cubicle platform operator; always false for an API key.

orgs*array<>

The organizations where the caller is an active member, ordered by name, with the caller's role in each; with an API key, only the key's organization.

apiKey?

Present when a service account's API key authenticated; orgs then holds only its org.

Example Request
curl -X GET 'https://api.cubicle.sh/v1/me'
Example Response
{  "id": "8e0a2c4e-6b8d-4f1a-a3c5-9e1b3d5f7a9c",  "identity": "acme/ci",  "operator": false,  "orgs": [    {      "id": "6b1f3d2a-8c4e-4f7a-9b2d-1e5c7a9f3b6d",      "name": "acme",      "role": "member",      "personal": false,      "boxCreateAllowed": true    }  ],  "apiKey": {    "id": "4b6d8f0a-2c4e-4a6b-8d0f-1a3c5e7b9d2f",    "orgId": "6b1f3d2a-8c4e-4f7a-9b2d-1e5c7a9f3b6d",    "scope": "write"  }}