บัญชี API
จัดการ API keys สำหรับบัญชี AgentSend ของคุณ สร้าง key สำหรับเอเจนต์หรือการเชื่อมต่อใหม่ แสดงรายการ key ที่มีอยู่ และเพิกถอน key ใดก็ได้ทันที
The full API key value is returned only once at creation time. Store it securely (e.g. in a secrets manager or environment variable) — it cannot be retrieved again.
Create API Key
Creates a new API key for the authenticated account. The response includes the full key string; this is the only time it will be visible.
Request Body
Content-Type: application/json
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
name |
string | A human-readable label for the key (e.g. "production-agent"). Optional. |
ตัวอย่าง 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
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
id |
string | Unique identifier for the 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 | Human-readable label provided at creation. |
message |
string | Advisory message reminding you to store the key securely. |
List API Keys
Returns all active API keys on the account. Key values are never returned in this endpoint — only metadata is exposed.
ตัวอย่าง 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
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
id |
string | Unique identifier for the API key. |
keyPrefix |
string | The visible prefix of the key, used to identify it without exposing the secret. |
name |
string | null | Human-readable label, if set at creation. |
lastUsedAt |
string | null | ISO 8601 timestamp 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 | ISO 8601 timestamp when the key was created. |
Revoke API Key
Permanently revokes an API key. Any requests authenticated with this key will be rejected immediately. This action cannot be undone.
Path Parameters
| พารามิเตอร์ | ประเภท | คำอธิบาย |
|---|---|---|
id จำเป็น |
uuid | The ID of the API key to revoke. |
ตัวอย่าง 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.