You and your company

GET/v1/me

Who this key acts as, which company and shops it reaches, what it may do, and when it ends.

What it does

The first call to make. It answers with the person who made the key, the company, the shops and categories the key reaches, the abilities it holds after the fence, and the moment it ends.

Who may call it

Any live key may call it. It reads only what the key's maker may already see about themselves.

Request

HTTP
GET https://panlytics.net/api/v1/me

Parameters

NameInTypeRequiredWhat it is
AuthorizationheaderstringYesBearer, a space, then the key.

Example request

curl https://panlytics.net/api/v1/me \
  -H "Authorization: Bearer $PANLYTICS_KEY"

Response

200: The answer, as JSON.

FieldTypeAlways thereWhat it is
userobjectYesThe person who made the key. The key acts as them, inside the fence.
user.idnumberYesThe maker's id.
user.usernamestringYesThe maker's username.
user.namestring or nullYesThe maker's full name, or null.
user.emailstringYesThe maker's email address.
organizationobjectYesThe company the key works in.
organization.idnumberYesThe company's id.
organization.namestringNoThe company's name.
rolestring or nullYes"CEO", or the name of the maker's role in that company.
reachobjectYesWhich shops and categories the key reaches.
reach.allShopsbooleanYesTrue when the role covers every shop, including shops opened later.
reach.shops[]object[]YesEvery shop the key reaches.
reach.shops[].idnumberYesThe shop's id.
reach.shops[].namestringYesThe shop's name.
reach.categoryScopedbooleanYesTrue when the role covers chosen categories of one shop rather than whole shops.
reach.categories[]number[] or nullYesThe category ids a category-scoped role covers. Null otherwise.
abilities[]string[]YesWhat the key may do after the fence, by id: figures, sheet, export, exceptions, agents, suppliers, brain, shops.
fencedbooleanYesAlways true for a key: people, roles, the audit log and the developer settings stay out of its reach.
keyobjectYesThe key itself.
key.idnumberYesThe key's own id, as the Developer pages and the audit log show it.
key.endsAtstring (ISO 8601)YesWhen the key stops working, in UTC. Shortening the company's period moves it sooner.

Example response

200
{
  "user": {
    "id": 7,
    "username": "anna",
    "name": "Anna Virtanen",
    "email": "anna@example.com"
  },
  "organization": {
    "id": 3,
    "name": "Example Oy"
  },
  "role": "Manager",
  "reach": {
    "allShops": false,
    "shops": [
      {
        "id": 12,
        "name": "Harbour"
      }
    ],
    "categoryScoped": false,
    "categories": null
  },
  "abilities": [
    "figures",
    "sheet",
    "export",
    "agents"
  ],
  "fenced": true,
  "key": {
    "id": 21,
    "endsAt": "2026-10-25T15:00:00.000Z"
  }
}

Errors

A refusal is JSON with a code, a sentence in error, and a requestId when the fault is ours. Read the code, not the sentence. Every code is listed on Errors.

StatusCodeWhenWhat to do
401api.key_missingThe call had no Authorization header.Send the key in the Authorization header as Bearer, then call again.
401api.key_refusedThe key is wrong, revoked, past its end, or its maker or company no longer allows it (developer mode off, the maker removed or switched off, or the maker's role lost the developer ability).Ask the person who gave you the key to make a new one.
401api.wrong_key_kindThis key does not open these endpoints.Use the key these endpoints were made for, or ask the person who gave you the key.
403refusedThe key's maker may not do this here: their role lacks the ability, or the shop or category is outside their reach.Ask the CEO for a role that allows it, or call it for a shop or category the role reaches.
403auth.not_freshThis step needs you to prove it is you.Confirm your password or passkey, then try again.
429api.rate_limitedThe key made more than 120 calls in this minute. Wait the seconds in Retry-After.Wait the seconds in Retry-After, then call again.
500serverSomething failed on our side. The answer carries a requestId to quote.Try again in a minute; if it keeps happening, report it.
503developer.unavailableAPI keys are not set up on this deployment yet.Report it, and we will switch them on.