Account
Manage API keys for your AgentSend account. Create keys for new agents or integrations, list existing keys, and revoke any key instantly.
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
| Field | Type | Description |
|---|---|---|
name |
string | A human-readable label for the key (e.g. "production-agent"). Optional. |
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
| Field | Type | Description |
|---|---|---|
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.
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
| Field | Type | Description |
|---|---|---|
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
| Parameter | Type | Description |
|---|---|---|
id required |
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.