Tài Khoản
Quản lý API key cho tài khoản AgentSend của bạn. Tạo key cho agent hoặc tích hợp mới, liệt kê key hiện có, và thu hồi key bất kỳ ngay lập tức.
Giá trị API key đầy đủ được trả về chỉ một lần khi tạo. Lưu an toàn (ví dụ trong secrets manager hoặc biến môi trường) — không thể lấy lại.
Tạo API Key
Tạo một API key mới cho tài khoản đã xác thực. Phản hồi bao gồm chuỗi key đầy đủ; đây là lần duy nhất nó sẽ hiển thị.
Nội Dung Yêu Cầu
Content-Type: application/json
| Trường | Kiểu | Mô tả |
|---|---|---|
name |
string | A human-readable label for the key (e.g. "production-agent"). Tùy chọn. |
Example Request
curl -X POST https://api.agentsend.io/account/api-keys \ -H "x-api-key: $AGENTSEND_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "production-agent"}'
Response — 201 Created
{
"id": "ak_01j9zxkp4qbc7n3m8td5e6fvg2",
"key": "as_live_v1_4xKqT2mNpRuWsYcBjDeGhLzA...",
"prefix": "as_live_v1_4xKq",
"name": "production-agent",
"message": "Store this key securely. It will not be shown again."
}CreatedApiKey Object
| Trường | Kiểu | Mô tả |
|---|---|---|
id |
string | Định danh duy nhất của API key. |
key |
string | The full API key value. Shown only once. |
prefix |
string | The visible prefix used to identify this key in listings. |
name |
string | null | Dễ đọc label provided at creation. |
message |
string | Advisory message reminding you to store the key securely. |
Liệt Kê API Keys
Returns all active API keys on the account. Key values are never returned in this endpoint — only metadata is exposed.
Example Request
curl https://api.agentsend.io/account/api-keys \
-H "x-api-key: $AGENTSEND_API_KEY"Response — 200 OK
{
"data": [
{
"id": "ak_01j9zxkp4qbc7n3m8td5e6fvg2",
"keyPrefix": "as_live_v1_4xKq",
"name": "production-agent",
"lastUsedAt": "2025-11-02T14:23:00Z",
"expiresAt": null,
"createdAt": "2025-10-15T09:00:00Z"
},
{
"id": "ak_02k0aylq5rcd8o4n9ue6f7gwh3",
"keyPrefix": "as_live_v1_9mHr",
"name": null,
"lastUsedAt": null,
"expiresAt": "2026-01-01T00:00:00Z",
"createdAt": "2025-12-01T10:30:00Z"
}
]
}ApiKey Object
| Trường | Kiểu | Mô tả |
|---|---|---|
id |
string | Định danh duy nhất của API key. |
keyPrefix |
string | The visible prefix of the key, used to identify it without exposing the secret. |
name |
string | null | Dễ đọc label, if set at creation. |
lastUsedAt |
string | null | Dấu thời gian ISO 8601 of the last authenticated request made with this key. |
expiresAt |
string | null | ISO 8601 expiry timestamp, or null if the key does not expire. |
createdAt |
string | Dấu thời gian ISO 8601 when the key được tạo. |
Thu Hồi API Key
Permanently revokes an API key. Any requests authenticated with this key will be rejected immediately. This action cannot be undone.
Path Parameters
| Tham số | Kiểu | Mô tả |
|---|---|---|
id bắt buộc |
uuid | The ID of the API key to revoke. |
Example Request
curl -X DELETE https://api.agentsend.io/account/api-keys/ak_01j9zxkp4qbc7n3m8td5e6fvg2 \
-H "x-api-key: $AGENTSEND_API_KEY"Response — 204 No Content
An empty response with status 204 confirms the key has been revoked. No response body is returned.
You cannot revoke the key currently used to authenticate the request. Use a different key (or the dashboard) to revoke a key in active use.