API Keys API
Manage your API keys programmatically.
Authentication Required
The API Keys endpoints require a valid session token (JWT) in the Authorization header, not an API key. These endpoints are primarily used by the web application.
List API Keys
/api/api-keysList all API keys
Returns a list of all API keys for the authenticated user. Only metadata is returned; the actual key values are not exposed.
Request
curl -X GET "https://explorableresearch.com/api/api-keys" \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"Response
{
"keys": [
{
"id": "key-uuid-here",
"description": "Production API",
"prefix": "sk_live_abc123...",
"created_at": "2024-01-15T10:30:00Z",
"last_used_at": "2024-01-20T14:22:00Z",
"is_revoked": false,
"expires_at": "2025-01-15T10:30:00Z"
},
{
"id": "key-uuid-here-2",
"description": "Development",
"prefix": "sk_test_xyz789...",
"created_at": "2024-01-10T08:00:00Z",
"last_used_at": null,
"is_revoked": false,
"expires_at": "2025-01-10T08:00:00Z"
}
]
}Try it out
/api/api-keysCreate API Key
/api/api-keysCreate a new API key
Creates a new API key. The full key is returned only once in the response; make sure to save it immediately.
Parameters
descriptionA descriptive name for the key (max 255 characters, alphanumeric with spaces, underscores, and hyphens)
scopeOptional scope for the key (reserved for future use)
Request
curl -X POST "https://explorableresearch.com/api/api-keys" \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"description": "Production API"}'Response
{
"api_key": "sk_live_abc123def456ghi789...",
"api_key_id": "key-uuid-here"
}Try it out
/api/api-keysGet API Key
/api/api-keys/:key_idGet API key metadata
Retrieves metadata for a specific API key. The actual key value is never returned.
Parameters
key_idThe unique identifier of the API key
Request
curl -X GET "https://explorableresearch.com/api/api-keys/key-uuid-here" \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"Response
{
"key": {
"id": "key-uuid-here",
"description": "Production API",
"prefix": "sk_live_abc123...",
"created_at": "2024-01-15T10:30:00Z",
"last_used_at": "2024-01-20T14:22:00Z",
"is_revoked": false,
"expires_at": "2025-01-15T10:30:00Z"
}
}Try it out
/api/api-keys/:key_idRevoke API Key
/api/api-keys/:key_idRevoke an API key
Permanently revokes an API key. This action cannot be undone. Any applications using this key will immediately lose access.
Parameters
key_idThe unique identifier of the API key to revoke
Request
curl -X DELETE "https://explorableresearch.com/api/api-keys/key-uuid-here" \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"Response
// Returns 204 No Content on successTry it out
/api/api-keys/:key_idRotate API Key
/api/api-keys/:key_id?action=rotateRotate an API key
Generates a new API key and immediately revokes the old one. The new key is returned in the response. Update your applications promptly.
Parameters
key_idThe unique identifier of the API key to rotate
actionMust be set to "rotate"
Request
curl -X POST "https://explorableresearch.com/api/api-keys/key-uuid-here?action=rotate" \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"Response
{
"api_key": "sk_live_new_key_xyz789...",
"api_key_id": "new-key-uuid-here"
}Try it out
/api/api-keys/:key_id?action=rotate