# 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

`Authorization`Bearer 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

`teamId`string

### Responses

#### 200Response for status 200

`$schema`string<uri>

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

`data`objectrequired

- `subject`objectrequired
  - `type`stringrequired
    - What the credential acts as: `user` a person, `team` a team's own machine credential, `external` an external customer's, `system` Spacefast itself.
  - `id`stringrequired
    - ID of that user, team, external customer, or system actor.
  - `user`object | anyrequired
    - The person behind the credential. Null when the credential acts as a team, an external customer, or Spacefast itself;
        - `id`stringrequired
          - ID of the signed-in account.
        - `email`string | anyrequired
          - The account's primary email address.
        - `name`string | anyrequired
          - Display name, null until the account sets one.
        - `isAutomattician`booleanrequired
          - Whether the account's WordPress.com login belongs to an Automattician.
        - `wpcom`object | anyrequired
          - The WordPress.com profile captured at the account's last WP.com sign-in, verbatim.
        - `isSuperadmin`booleanrequired
          - Whether this browser session belongs to a platform operator.
        - `pendingDeletionAt`string | anyrequired
          - ISO 8601 timestamp for when the account's closure was requested.
        - `dashboardPrefs`objectrequired
          - The account's dashboard preferences.
        - `privacy`objectrequired
          - The account's opt-out elections.
            - `analyticsOptOut`booleanrequired
            - `advertisingOptOut`booleanrequired
  - `tenants`object[]required
    - The tenants the credential's policy reaches.
      - `id`stringrequired
      - `kind`stringrequired
      - `name`stringrequired
      - `access`stringrequired
  - `teams`object[]required
    - The teams the credential can act in:
      - `id`stringrequired
      - `name`stringrequired
      - `slug`string | anyrequired
      - `role`string | anyrequired
      - `plan`stringrequired
  - `intercom`object | anyrequired
    - Everything the Intercom Messenger needs to boot.
      - `api_base`string<uri>required
      - `app_id`stringrequired
      - `user_id`stringrequired
      - `email`string<email>
      - `name`string
      - `created_at`integer
      - `company`object
        - `company_id`stringrequired
        - `name`stringrequired
        - `plan`string
      - `intercom_user_jwt`stringrequired
      - `session_duration`integerrequired
      - `expiresAt`string<date-time>required
  - `beta`objectrequired
    - Private-beta state.
      - `gateEnabled`booleanrequired
      - `enrolled`booleanrequired
      - `eligibleTeams`object[]required
        - Teams the account may join to get in.
          - `teamId`stringrequired
          - `name`stringrequired
          - `slug`string | anyrequired
          - `source`stringrequired

### Try it

#### Server

Base URLhttps://api.spacefast.com

### Parameters

`teamId`query

### Request examples

```bash
curl -X GET "https://api.spacefast.com/v1/me" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

```javascript
const response = await fetch("https://api.spacefast.com/v1/me", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN"
  }
});
```

```python
import requests

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

### Response:

```json
{
  "$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"
        }
      ]
    }
  }
}
```

```json
{
  "$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"
}
```
