> For the complete documentation index, see [llms.txt](https://docs.limephone.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.limephone.io/api-reference/analytics-and-devices.md).

# Analytics & devices

## Usage summary

`GET /v1/analytics/usage` — scope `analytics:read`

Total calls, messages and API requests for your organization.

```json
{
  "calls": 1284,
  "messages": 5410,
  "apiRequests": 90312
}
```

## Call analytics

`GET /v1/analytics/calls` — scope `analytics:read`

Call counts grouped by status.

```json
{
  "data": [
    { "status": "completed", "count": 1121 },
    { "status": "missed", "count": 163 }
  ]
}
```

## Message analytics

`GET /v1/analytics/messages` — scope `analytics:read`

Message counts grouped by direction (`inbound` / `outbound`).

## Register a device

`POST /v1/devices` — scope `devices:write`

Registers a push-notification device token, for custom mobile integrations. Upserts by token: registering the same token again refreshes it (`200`) instead of duplicating (`201` for a new token).

| Field      | Type   | Required | Notes                        |
| ---------- | ------ | -------- | ---------------------------- |
| `token`    | string | yes      | The push token from FCM/APNs |
| `platform` | string | no       | `android` (default) or `ios` |

## Unregister a device

`DELETE /v1/devices` — scope `devices:write`

Unregisters a device token (passed in the body, not the path). `404` when the token is not registered.

```bash
curl -X DELETE https://dashboard.limephone.io/api/v1/devices \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "token": "fcm_dQw4..." }'
```

## Health check

`GET /v1/health` — any valid key

Confirms your key authenticates and the API is up. Useful as an integration smoke test.

```json
{
  "status": "ok",
  "version": "1.0.0",
  "timestamp": "2026-09-04T09:12:44.000Z"
}
```
