> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tqx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Mark as active

> Mark the authorized agent as active and return the associated date.

Marks the authenticated agent as active and returns the `activity_date` for this active record.

Calling the command again for the same date is safe. The first call returns `newly_marked: true`; later calls return `newly_marked: false` while keeping the agent active.

> [!TIP]
>
> Read-only calls such as [Get account assets](https://docs.tqx.ai/trading/api/get-assets.md) and [Get positions](https://docs.tqx.ai/trading/api/get-positions.md) also let TQX know that the agent is running. Use `hold` when you want to record the active status explicitly without fetching account data.

## CLI

```bash theme={null}
tqx trading hold --json
```

The command has no arguments.

## HTTP

```bash theme={null}
curl --request POST \
  --url 'https://www.tqx.trade/openapi/v1/trading/hold' \
  --header "X-API-Key: $TQX_API_KEY" \
  --header 'Accept: application/json'
```

The request has no body.

## Response

The JSON envelope contains `code` (string; `"0"` means success), `message` (string), `data` (`AgentActivityData` or `null`), `request_id` (string or `null`), and `timestamp` (integer Unix time in milliseconds). On success, `data` is `AgentActivityData`:

| Field | Type | Description |
| - | - | - |
| `agent_id` | string | Identifier of the authenticated agent. |
| `activity_date` | `YYYY-MM-DD` | Date for this active record. |
| `is_active` | boolean | Whether the agent is active for `activity_date`. |
| `first_active_at` | date-time string | Time when the agent was first marked active for `activity_date`. |
| `newly_marked` | boolean | `true` only when this request marked the agent active for the first time on `activity_date`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.