# List connected accounts — `GET /v1/account/sessions`

> List connected accounts bound to your API key with internal account_id, device fingerprint, and health metadata.

- **Endpoint:** `GET https://api.tikultra.com/v1/account/sessions`
- **Auth Header:** `x-api-key: $TIKULTRA_KEY`
- **Pool:** Your Account (Runs on a connected account you own)
- **Plan Access:** Starter and up
- **Quota Weight:** Free (0 req) (`0` req on any failed call)
- **Upstream Mobile Path(s):** `gateway · bound accounts registry`

## Parameters

No endpoint-specific parameters required.

## What it returns

Returns JSON decoded from `gateway · bound accounts registry`. Identifier fields (`aweme_id`, `uid`, `sec_uid`, `room_id`, `product_id`) match input names on follow-up endpoints.

### Billing & telemetry headers on every response

- `x-request-id`: Unique gateway trace ID for support and debugging.
- `x-ratelimit-remaining`: Remaining requests in your current rate-limit window.
- `x-quota-weight`: Request weight for this call (0 reqs on 200 OK; always 0 on failed calls).

### Key decoded response fields

| Field | Type | Description |
| --- | --- | --- |
| `sessions` | `object[]` | Decoded list of `sessions` records (1 shown in sample). |
| `count` | `number` | Decoded `count` value returned from gateway · bound accounts registry. |

## How to use it: Account Sign-In, Session Import & Health Lifecycle

Bind an existing TikTok account you own onto a dedicated 1:1 mobile hardware context, verify session health, and keep passport tokens fresh.

1. **Import session cookies OR start email OTP** — [`POST /v1/account/import`](https://tikultra.com/docs/api/import-session) (10 reqs): Import an exported sessionid via POST /v1/account/import, or trigger passwordless OTP via /v1/account/login/otp/send.
2. **Complete OTP verification (if using email sign-in)** *(optional)* — [`POST /v1/account/login/otp/verify`](https://tikultra.com/docs/api/otp-verify) (10 reqs): Submit the 6-digit code to /v1/account/login/otp/verify to persist your Connected Workspace account_id.
3. **Verify session health & warm tier** — [`GET /v1/account/health`](https://tikultra.com/docs/api/account-health) (1 req): Call GET /v1/account/health?account_id=... before running publishing, DM, or Studio workflows.
4. **List connected accounts** **(THIS ENDPOINT)** — [`GET /v1/account/sessions`](https://tikultra.com/docs/api/account-sessions) (Free): List connected accounts bound to your API key with internal account_id, device fingerprint, and health metadata. (GET /v1/account/sessions).
5. **Refresh passport & MSSDK session state** *(optional)* — [`POST /v1/account/session`](https://tikultra.com/docs/api/session-state) (3 reqs): Periodically run POST /v1/account/session to refresh passport account info and token heartbeat.

> **Agent Tip:** Store the returned account_id in your database. One account_id stays bound to one dedicated device_id and city egress across restarts.

## Code examples (cURL, TypeScript SDK, Python SDK)

### TypeScript SDK
```ts
import { TikUltra } from 'tikultra'

const client = new TikUltra({ apiKey: process.env.TIKULTRA_KEY })

const res = await client.request('GET', '/v1/account/sessions')
console.log(res.data)
```

### Python SDK
```python
import os
from tikultra import TikUltra

with TikUltra(api_key=os.environ["TIKULTRA_KEY"]) as client:
    res = client.request("GET", "/v1/account/sessions")
    print(res.data)
```

### cURL
```bash
curl -G https://api.tikultra.com/v1/account/sessions \
  -H "x-api-key: $TIKULTRA_KEY"
```

### Python (HTTP)
```python
import os, requests

r = requests.get(
    "https://api.tikultra.com/v1/account/sessions",
    params={},
    headers={"x-api-key": os.environ["TIKULTRA_KEY"]},
)
print(r.json())
```

### JavaScript
```bash
const url = new URL('https://api.tikultra.com/v1/account/sessions')
url.search = new URLSearchParams({  }).toString()

const res = await fetch(url, { headers: { 'x-api-key': process.env.TIKULTRA_KEY } })
console.log(await res.json())
```

## Sample 200 JSON response

```json
{
  "sessions": [
    {
      "account_id": "acc_7Hq2",
      "context_id": "ctx_9mK4vP2x",
      "device_id": "7392011847562901234",
      "uid": "107955",
      "username": "yourstudio",
      "nickname": "Your Studio",
      "health": "healthy",
      "warm_tier": "calibrated_warm",
      "region": "US",
      "os": "android"
    }
  ],
  "count": 1
}
```
