# Health, snapshot and audit trail (Account REST API (/users/current))

> Tickwire API reference, generated from the OpenAPI document the services export. Base URL: https://api.tickwire.io. Replace YOUR_API_KEY and YOUR_ACCOUNT_ID with your own values; use a sandbox key (twsk_…) to experiment.

Source: https://tickwire.io/docs/reference/account-health-audit/

### GET /users/current/accounts/{account_id}/audit

**Account Audit**

Auth: `auth-token`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |
| `limit` | query | `integer` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `404` [`account_not_found`](https://tickwire.io/docs/errors/account_not_found/)
- `503` [`not_connected`](https://tickwire.io/docs/errors/not_connected/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/audit' \
  -H 'auth-token: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/users/current/accounts/YOUR_ACCOUNT_ID/audit",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/audit");
console.log(result);
tw.close();
```

### GET /users/current/accounts/{account_id}/health

**Account Health**

Auth: `auth-token`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `404` [`account_not_found`](https://tickwire.io/docs/errors/account_not_found/)
- `503` [`not_connected`](https://tickwire.io/docs/errors/not_connected/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/health' \
  -H 'auth-token: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/users/current/accounts/YOUR_ACCOUNT_ID/health",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/health");
console.log(result);
tw.close();
```

### GET /users/current/accounts/{account_id}/snapshot

**Account Snapshot**

Auth: `auth-token`

Account information, positions, orders, health and server time in one
read (MT4 and MT5). Agents reach it as `GET /v1/agent/accounts/{id}/snapshot`.

Body: `{account_id, platform, as_of, complete, terminal_connected,
account_information, positions, orders, health, server_time}`. `as_of` is
when the snapshot was complete (UTC); `complete` is true when every section
is `ok`; `terminal_connected` is `null` when it is not known.

Each section is `{status, read_at, age_ms, data, error?}`. `status` is
`ok` (read from a terminal connected to its broker), `stale` (read, but
the terminal was not connected, so values may be out of date) or
`unavailable` (`data` is `null` and `error` is `{error, message}`);
`health` and `server_time` are `ok` whenever they could be read.
Sections are read one after another: compare `read_at` when that matters.
`data` has the same shape as the individual routes; `server_time` gives
`brokerUtcOffsetMinutes` (`null` until known, never assumed to be 0).

Always 200 (an unreadable section says so); 503 only if nothing could be read.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `404` [`account_not_found`](https://tickwire.io/docs/errors/account_not_found/)
- `503` [`not_connected`](https://tickwire.io/docs/errors/not_connected/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/snapshot' \
  -H 'auth-token: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/users/current/accounts/YOUR_ACCOUNT_ID/snapshot",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/snapshot");
console.log(result);
tw.close();
```
