Get the caller's identity - Spacefast Docs

Get the caller's identity

Returns the subject behind the calling credential, the user account when the subject is a person, the tenants the credential’s policy reaches, every team it can act in with that team’s plan, and private-beta state. user is null for a team-subject or service-subject credential. intercom is present only for a signed-in dashboard browser session.

GET/v1/me

Authorization

AuthorizationBearer token · headerrequired

Authorization: Bearer <token> with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).

Query parameters

teamIdstring

Responses

200Response for status 200

$schemastring

Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.

dataobjectrequired

Try it

Server

Base URLhttps://api.spacefast.com

Parameters

teamIdquery

Request examples

curl -X GET "https://api.spacefast.com/v1/me" \
  -H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.spacefast.com/v1/me", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN"
  }
});
import requests

response = requests.get(
    "https://api.spacefast.com/v1/me",
    headers={
        "Authorization": "Bearer YOUR_TOKEN"
    },
)

Response:

{
  "$schema": "http://example.com",
  "data": {
    "subject": {
      "type": "user",
      "id": "string"
    },
    "user": {
      "id": "string",
      "email": "string",
      "name": "string",
      "isAutomattician": true,
      "wpcom": {
        "property1": null,
        "property2": null
      },
      "isSuperadmin": true,
      "pendingDeletionAt": "string",
      "dashboardPrefs": {
        "property1": null,
        "property2": null
      },
      "privacy": {
        "analyticsOptOut": true,
        "advertisingOptOut": true
      }
    },
    "tenants": [
      {
        "id": "string",
        "kind": "string",
        "name": "string",
        "access": "full"
      }
    ],
    "teams": [
      {
        "id": "string",
        "name": "string",
        "slug": "string",
        "role": "string",
        "plan": "free"
      }
    ],
    "intercom": {
      "api_base": "http://example.com",
      "app_id": "string",
      "user_id": "string",
      "email": "user@example.com",
      "name": "string",
      "created_at": 9007199254740991,
      "company": {
        "company_id": "string",
        "name": "string",
        "plan": "free"
      },
      "intercom_user_jwt": "string",
      "session_duration": 9007199254740991,
      "expiresAt": "2019-08-24T14:15:22Z"
    },
    "beta": {
      "gateEnabled": true,
      "enrolled": true,
      "eligibleTeams": [
        {
          "teamId": "string",
          "name": "string",
          "slug": "string",
          "source": "invitation"
        }
      ]
    }
  }
}
{
  "$schema": "http://example.com",
  "type": "string",
  "title": "string",
  "status": -9007199254740991,
  "detail": "string",
  "code": "string",
  "pointer": "string",
  "details": {
    "property1": null,
    "property2": null
  },
  "suggestions": [
    "string"
  ],
  "next": [
    "string"
  ],
  "requestId": "string"
}