# agent.console_get

`GET /api/public/v1/agent/console`

Quyền giữ và trạng thái thao tác theo hồ sơ, không trả nội dung kết quả hay bí mật.

- Quyền: `session.read`
- Lệnh (chống trùng): Không
- Tool MCP: `agent_console_get`

## Tham số

| Tên | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
| `profile_id` | query | string (uuid) | Không |  |

## Phản hồi

200 với { data, correlation_id }.

| Trường | Kiểu | Luôn có | Mô tả |
|---|---|---|---|
| `data` | object | Có |  |
| `data.profiles` | array<object> | Có |  |
| `data.profiles[].profile_id` | string (uuid) | Có |  |
| `data.profiles[].name` | string | Có |  |
| `data.profiles[].lease` | object \| null | Có |  |
| `data.profiles[].lease.profile_id` | string (uuid) | Có |  |
| `data.profiles[].lease.session_id` | string (uuid) \| null | Có |  |
| `data.profiles[].lease.epoch` | integer | Có | (tối thiểu 0, tối đa 9007199254740991) |
| `data.profiles[].lease.holder_kind` | string | Có |  |
| `data.profiles[].lease.expires_at` | string | Có |  |
| `data.profiles[].lease.control_mode` | "quiet" \| "compat" | Có |  |
| `data.profiles[].lease.handoff_state` | "AGENT_CONTROLLED" \| "PAUSING" \| "HUMAN_CONTROLLED" \| "RESUME_PENDING" | Có |  |
| `data.profiles[].lease.released_at` | string \| null | Có |  |
| `data.profiles[].operations` | array<object> | Có |  |
| `data.profiles[].operations[].id` | string (uuid) | Có |  |
| `data.profiles[].operations[].op` | string | Có |  |
| `data.profiles[].operations[].state` | "pending" \| "succeeded" \| "failed" \| "unknown" | Có |  |
| `data.profiles[].operations[].created_at` | string | Có |  |
| `data.profiles[].operations[].state_version` | integer | Có | (tối thiểu 0, tối đa 9007199254740991) |
| `data.profiles[].sessions` | array<object> | Có |  |
| `data.profiles[].sessions[].id` | string (uuid) | Có |  |
| `data.profiles[].sessions[].lifecycle` | string | Có |  |
| `data.profiles[].sessions[].created_at` | string | Có |  |
| `data.profiles[].sessions[].budget` | object \| null | Có |  |
| `data.profiles[].preflight` | object | Có |  |
| `data.profiles[].preflight.measured` | boolean | Có |  |
| `data.profiles[].preflight.ready` | boolean \| null | Có |  |
| `correlation_id` | string (uuid) | Có |  |
| `ok` | true | Không |  |
| `operation_id` | string \| null | Không |  |
| `state_version` | integer | Không | (tối thiểu 0) |
| `retryable` | false | Không |  |
| `next` | null | Không |  |

Trường mới có thể xuất hiện bất cứ lúc nào; hãy bỏ qua trường bạn không biết.

## Lỗi

| Mã | HTTP | Thử lại |
|---|---|---|
| `UNAUTHENTICATED` | 401 | Không |
| `FORBIDDEN` | 403 | Không |
| `RATE_LIMITED` | 429 | Có |
| `VALIDATION_FAILED` | 422 | Không |
| `DEPENDENCY_UNAVAILABLE` | 503 | Có |
| `UNKNOWN` | 500 | Không |

## Ví dụ (curl)

```bash
curl "https://browlix.com/api/public/v1/agent/console" \
  -H "Authorization: Bearer $BROWLIX_API_KEY"
```

## Ví dụ (TypeScript SDK)

```ts
import { Browlix } from "@browlix/sdk";

const bx = new Browlix({ apiKey: process.env.BROWLIX_API_KEY! });
const reply = await bx.call("agent.console_get");
console.log(reply.data);
```

## Ví dụ (Python)

```python
import os
import requests

r = requests.get(
    "https://browlix.com/api/public/v1/agent/console",
    headers={"Authorization": f"Bearer {os.environ['BROWLIX_API_KEY']}"},
    timeout=60,
)
print(r.status_code, r.json())
```

## Ví dụ (MCP)

```json
{
  "method": "tools/call",
  "params": {
    "name": "agent_console_get",
    "arguments": {}
  }
}
```
