# List accounts

Lists your TikTok accounts, newest first, with their id, username and status. GET /accounts.

`GET https://api.tiktornado.com/api/v1/accounts`

Scope: `accounts:read`.

Lists your TikTok accounts, newest first, with their id, username and status. Only accounts with status `active`, `shadow_banned` or `needs_reconnecting` can take new posts. An account whose subscription isn't active is listed with status `suspended` and refuses every request about it with `access_locked`.

## Examples

```bash
curl 'https://api.tiktornado.com/api/v1/accounts' \
  -H "Authorization: Bearer $TIKTORNADO_API_KEY"
```

```js
const response = await fetch("https://api.tiktornado.com/api/v1/accounts", {
  headers: {
    Authorization: `Bearer ${process.env.TIKTORNADO_API_KEY}`,
  },
});
const data = await response.json();
```

```python
import os

import requests

response = requests.get(
    "https://api.tiktornado.com/api/v1/accounts",
    headers={
        "Authorization": f"Bearer {os.environ['TIKTORNADO_API_KEY']}",
    },
)
data = response.json()
```

## Response 200

Your accounts.

- `accounts` array of objects, required
  - `id` string, required: An id, letters and digits only. Matches `^[A-Za-z0-9]{1,64}$`.
  - `username` string or null, required: The TikTok username, or `null` before it is set.
  - `status` string, required: - `creating`, `warming_up`, `ready_for_setup`: the account is being made ready.
    - `active`: posting normally.
    - `shadow_banned`: TikTok shows its posts to fewer people. It can still post.
    - `needs_reconnecting`: being reconnected to TikTok. It can still take posts: they go out once it's back.
    - `appealing_ban`: TikTok is reviewing a ban. No new posts.
    - `banned`, `inactive`: can't post.
    - `suspended`: its subscription isn't active. Fix it under Billing in the tiktornado app. One of `creating`, `warming_up`, `ready_for_setup`, `active`, `shadow_banned`, `needs_reconnecting`, `appealing_ban`, `banned`, `inactive`, `suspended`.

```json
{
  "accounts": [
    {
      "id": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
      "username": "liftwithmaya",
      "status": "active"
    },
    {
      "id": "j975bq1hkz8d3w0xn6c2tfr4p87v9m5a",
      "username": null,
      "status": "warming_up"
    }
  ]
}
```

## Errors

| Status | Reason | Message |
| --- | --- | --- |
| 401 | `api_key_invalid` | This API key isn't valid. Check it, or create a new one in the app. |
| 403 | `access_locked` | Your subscription isn't active, so this can't be changed right now. Visit Billing to fix it. |
| 403 | `api_scope_missing` | This API key can't do this. Create a key with the access it needs in the app. |
| 429 | `slow_down` | You're going a bit fast. Wait a moment and try again. |
| 500 | `unknown_error` | Something went wrong on our side. We're on it. |
| 503 | `service_unavailable` | Something went wrong on our side. We're on it. |