> ## Documentation Index
> Fetch the complete documentation index at: https://docs.9pic.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Account

> Get the signed-in 9Pic account and the organisations it can access

## Overview

Returns the 9Pic account behind an [OAuth access token](/api-reference/authentication#oauth-access-tokens) and every organisation that account can access, with its role in each. Use the returned `org_id` values in org-scoped paths such as [List Events](/api-reference/list-events).

This endpoint accepts **OAuth access tokens only**. An `X-API-Key` is already scoped to a single organisation, so there is nothing to look up and the call returns `403`.

## Endpoint

```
GET /api/v1/ext/account
```

**Required scope:** `events:read`

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -i \
    -H "Authorization: Bearer <oauth_access_token>" \
    "https://api.9pic.ai/api/v1/ext/account"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.9pic.ai/api/v1/ext/account",
      headers={"Authorization": "Bearer <oauth_access_token>"},
  )
  print(response.status_code, response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.9pic.ai/api/v1/ext/account",
    { headers: { Authorization: "Bearer <oauth_access_token>" } }
  );
  console.log(response.status, await response.json());
  ```
</CodeGroup>

## Example Response

```json theme={null}
{
  "responseType": "success",
  "message": "Account fetched successfully",
  "data": {
    "account_label": "organiser@example.com",
    "scopes": ["analytics:read", "events:read", "events:write"],
    "organisations": [
      { "org_id": 903, "name": "City Marathon", "slug": "city-marathon", "role": "admin" },
      { "org_id": 911, "name": "Trail Series", "slug": "trail-series", "role": "user" }
    ]
  }
}
```

Organisations are sorted by name. Pending team invitations are not included until the user accepts them.

## Response Models

The payload inside `data` (`AccountData`):

| Field | Type | Description |
| - | - | - |
| `data.account_label` | string \| null | Email of the signed-in 9Pic account. |
| `data.scopes` | string\[] | Scopes granted to this token, sorted. |
| `data.organisations` | AccountOrganisation\[] | Organisations the account can access. Empty when it has none. |

`AccountOrganisation`:

| Field | Type | Description |
| - | - | - |
| `org_id` | number | Organisation ID to use in `/api/v1/ext/{org_id}/...` paths. |
| `name` | string \| null | Organisation name. |
| `slug` | string \| null | Organisation slug. |
| `role` | string | The account's role in this organisation: `admin` or `user`. |

## Error Responses

| Status | Meaning |
| - | - |
| `400` | Both `X-API-Key` and a bearer token were sent. |
| `401` | No credentials, or the bearer token is malformed, expired, or could not be verified. |
| `403` | Called with an `X-API-Key`, no 9Pic account is linked to the sign-in, the account is inactive, the `events:read` scope is missing, or the host is not approved. |
| `429` | Rate limit exceeded. Back off and retry. |

See [Errors](/api-reference/errors) for canonical descriptions and retry guidance.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.