# Account

The token, its team, its plan and its consumption.

## Describe the current token

`GET /v1/me`

Returns the token, the member it belongs to, the team it acts for, the
plan the server resolves right now, and the API verbs that plan opens.
This is the first call of any integration.


- Required scopes: -
- Rate-limit cost: 1 unit(s)

### Responses

- `200`: The current token and its context.
- `401`: Missing, invalid or expired token, or a member who left the team.
- `403`: The plan does not include the API (`api.not_in_plan`) or this verb
(`api.write_not_in_plan`), or the token lacks a scope
(`token.missing_scope`).

- `429`: The plan rate limit is exhausted for one window.

### Request example (cURL)

```bash
curl "https://api.nessflow.com/v1/me" \
  -H "Authorization: Bearer $NESSFLOW_TOKEN"
```

### Response example

```json
{
    "data": {
        "token": {
            "id": "0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57",
            "name": "Exemple",
            "scopes": [
                "string"
            ],
            "expires_at": "2026-10-01T09:30:00Z",
            "last_used_at": "2026-10-01T09:30:00Z",
            "created_at": "2026-10-01T09:30:00Z"
        },
        "user": {
            "name": "Exemple",
            "email": "dev@exemple.fr"
        },
        "team": {
            "slug": "string",
            "name": "Exemple"
        },
        "plan": {
            "key": "string",
            "label": "string"
        },
        "api_access": [
            "read"
        ]
    }
}
```

## Read rate limits and plan quotas

`GET /v1/usage`

Returns the consumption of each rate-limit window, in cost units, and
the plan quotas of the team (projects, crawls this month, tracked
keywords...), the same gauges as the Usage screen.

A `limit` of `null` means **unlimited**; `0` means **not included in the
plan**. Never read `null` as zero.


- Required scopes: -
- Rate-limit cost: 1 unit(s)

### Responses

- `200`: Rate limits and quotas.
- `401`: Missing, invalid or expired token, or a member who left the team.
- `403`: The plan does not include the API (`api.not_in_plan`) or this verb
(`api.write_not_in_plan`), or the token lacks a scope
(`token.missing_scope`).

- `429`: The plan rate limit is exhausted for one window.

### Request example (cURL)

```bash
curl "https://api.nessflow.com/v1/usage" \
  -H "Authorization: Bearer $NESSFLOW_TOKEN"
```

### Response example

```json
{
    "data": {
        "rate_limits": [
            {
                "window": "minute",
                "window_seconds": 42,
                "unit": "cost",
                "limit": 100,
                "used": 42,
                "remaining": 100,
                "resets_in_seconds": 42
            }
        ],
        "quotas": [
            {
                "entitlement": "string",
                "used": 42,
                "limit": 100,
                "remaining": 100
            }
        ]
    }
}
```

## List running operations

`GET /v1/operations`

What is running right now for the team: crawls, keyword research, security scans,
project preflights and backlink syncs, newest first. An operation nothing takes
care of any more is never reported as running. The list is capped; `meta.total`
says how many there are. Log analyses, recommendations and semantic analyses
are not listed: read their own resources.


- Required scopes: `projects:read`
- Rate-limit cost: 1 unit(s)

### Responses

- `200`: OK.
- `401`: Missing, invalid or expired token, or a member who left the team.
- `403`: The plan does not include the API (`api.not_in_plan`) or this verb
(`api.write_not_in_plan`), or the token lacks a scope
(`token.missing_scope`).

- `429`: The plan rate limit is exhausted for one window.

### Request example (cURL)

```bash
curl "https://api.nessflow.com/v1/operations" \
  -H "Authorization: Bearer $NESSFLOW_TOKEN"
```

### Response example

```json
{
    "data": [
        {
            "kind": "crawl",
            "project_id": "0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57",
            "started_at": "2026-10-01T09:30:00Z",
            "crawl": {
                "id": "0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57",
                "stage": "string",
                "progress": 42,
                "pages_crawled": 42,
                "page_budget": 42
            }
        }
    ],
    "meta": {
        "total": 42,
        "shown": 42
    }
}
```
