What the credential you present is worth
OpenAPI JSONconst url = 'https://api.eu.apigami.com/v1/me';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.eu.apigami.com/v1/me \ --header 'Authorization: Bearer <token>'One route for every Apigami credential, because the question is always the same. A user session, a personal token or an agent token answers with the account and its team; an API key with the application it runs; the run token a hosted application is handed answers with the invocation it is serving — which application, which action, which version and whether that version serves production. A page’s token, or a page Apigami hosts calling through /__apigami/v1/me of its own address, answers with the page it opened; a page’s token is refused, with the same 401, from another origin than its page’s. Everything the token was worth when it was minted is re-read: its life, its parents, the team, the authorisation that allowed the call, and, for an invocation with a browser, that the user has not disconnected it. Any of those gone is a 401. There is nothing to send: the answer is derived from the credential, so it can only ever describe that credential. It never returns a browser identifier.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”For a page at its application’s own address, the path the page sits on: the answer then names that page in page_id and page_kind. apigami.js sends it for you.
Responses
Section titled “Responses”What the credential is worth. subject says which shape it is.
object
object
object
The application this invocation is running — yours, when you read this with your own run token.
The application that called this one, when one did. For a page’s token, the application the person connected to, however many applications lie between: its page is opened for that one.
The application the user connected to, unchanged down a chain of calls. For the run of a task, the application whose task it is, even a sub-app: the one that asked for the task is caller_app_id.
Whether that version is the one serving production right now. Compare it with your own APIGAMI_VERSION_ID before any effect.
extension: a browser is engaged. application: none is.
The person this invocation serves, as your group knows them. For the application they connected to, the same user_ref its webhooks and POST /connect/token carry; called as a sub-app, the ref of your own group, which your key’s routes (GET /v1/users, X-Apigami-User-Ref) know from then on while your application reaches them. Null when the invocation serves nobody. An API-key call that names a user with X-Apigami-User-Ref keeps them, with or without a browser.
A stable reference to the browser, for this application only. It says two invocations came from the same one, and nothing more. Never a browser identifier.
The id of the page this token was opened for, as your manifest declares it; for a page full page at its application’s own address, the page served at path. Null for any token that is not a page’s.
The kind of that page. A home page opens full page from the application’s connect link. A settings page is the side panel’s last tab, and also opens full page from that link when there is no home. A page is reached by a link or a redirect only.
The browser a page’s token drives, as your group knows it: the same install_ref the side panel hands the page, and a page opened full page reads here. Null for a page without a browser and for any token that is not a page’s.
The language the person reads Apigami in, which they choose in their account: en, fr, es or de. Write to them in it. Null when the invocation serves nobody.
The person’s name and email, when the version judging declares identity and the person granted it to an application of your group that reaches yours through applications of your group only; or, your application declared optional by an application of another group, once the person authorized its own line there, reached through the two groups only, their email verified, read with your key or from your own page, never in a call from that application; null otherwise. Never in an event. Judged on the version running; null when the invocation serves nobody.
object
The name the person gave, null while they have none: never their email in its place.
What the person this invocation serves still has to do, for the called application or one it reaches: an action of that application answered X-Apigami-Settings: setup or reconnect, and none has answered ok since. Empty when there is nothing, or when the invocation serves nobody. Send the person to the connect link of the application they connected to: its home page shows the settings of the applications it calls.
object
For a page’s token, whether the application the person connected to (root_app_id) has a settings page: apigami.js then adds a « Settings » button to the home, which opens it.
For a page’s token, the address of the home page of the application the person connected to, else of its settings page, production’s or --staging’s as the person came, its own domain first: where apigami.done() leads. Null for any other token, and when that application has neither.
For a page’s token, the address of the application that called this one (caller_app_id): the one origin a window apigami.open() opened posts apigami:settings-changed to.
The address the application the person connected to (root_app_id) gives this one’s public pages, https:// and its active domain: the origin to write into every link sent out of a page. Null when it gives none, and for the root itself.
Example
{ "subject": "user"}No credential, or one that is no longer worth anything: bad run token, or bad page token for a page’s.
object
Present and true when the approval window is open and the user has not answered within 45 s.
On consent requested and no grant from emails.send or ai.generate: the permission the user never decided, or refused. Absent for a site.
On no grant: the page of the user’s Apigami space where they allow it again; send them there.
On consent requested, in place of permission: the bare app_id of each application whose terms or subprocessors the user has yet to agree to, unlike the boxes of GET /apps/{app_id}. Only the connect page asks it: send them to connect_url, or to one of your pages.
With terms, when the user agrees under your application: your install link, where they tick the boxes still to tick.
Example
{ "error": "bad run token"}