Skip to main content

Get API Key

Retrieve a specific API key by ID. Users can only access their own API keys.
path
integer
required
API key ID
curl -X GET "https://api.example.com/api/v1/api_keys/1" \
  -H "X-API-Key: your-api-key-here"

Response

status
object
Response status information
code
integer
HTTP status code (200)
message
string
Status message
data
object
API key object (key_value is not included)
{
  "status": {
    "code": 200,
    "message": "Success"
  },
  "data": {
    "id": 1,
    "key_type": "private",
    "name": "Production API Key",
    "key_value": null,
    "allowed_origins": ["https://example.com"],
    "allowed_assistants": ["123"],
    "transient_assistant": false,
    "user_id": 1,
    "user_email": "[email protected]",
    "created_at": "2024-01-10T08:00:00Z",
    "updated_at": "2024-01-10T08:00:00Z"
  }
}
The key_value field is always null when retrieving an existing API key. It is only returned when creating a new key.

Error Responses

401
object
Unauthorized - Invalid or missing authentication
404
object
API key not found