# Identity API

> GET /api/v1/me and GET /api/v1/organizations — check the current user, organization, role and token abilities.

Source: https://falak.sh/docs/api/identity/

Use these endpoints to check a token before doing anything else.

## `GET /api/v1/me`

Returns the token's user, its organization with the user's role, and the token's name and abilities.

```bash
curl https://falak.example.com/api/v1/me \
  -H "Authorization: Bearer $FALAK_TOKEN" -H "Accept: application/json"
```

```json title="200 OK"
{"data": {
  "user": {"id": "01k…", "name": "Ada", "email": "ada@example.com"},
  "organization": {"id": "01k…", "name": "Acme", "slug": "acme", "role": "owner"},
  "token": {"name": "cli", "abilities": ["*"]}
}}
```

| Field | Meaning |
|---|---|
| `organization.role` | `owner`, `admin`, `developer` or `viewer` |
| `token.abilities` | Permission names, or `["*"]` |

## `GET /api/v1/organizations`

A token request returns the token's organization only; a browser session returns every membership.

```json title="200 OK"
{"data": [{"id": "01k…", "name": "Acme", "slug": "acme", "role": "owner", "current": true}]}
```
