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

GET
/api/api-keys

List 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

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

Sign in to use the interactive API playground
GET
/api/api-keys

Create API Key

POST
/api/api-keys

Create 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

description
Required
string

A descriptive name for the key (max 255 characters, alphanumeric with spaces, underscores, and hyphens)

scope
string

Optional 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

Response (201 Created)
{
  "api_key": "sk_live_abc123def456ghi789...",
  "api_key_id": "key-uuid-here"
}

Try it out

Sign in to use the interactive API playground
POST
/api/api-keys

Get API Key

GET
/api/api-keys/:key_id

Get API key metadata

Retrieves metadata for a specific API key. The actual key value is never returned.

Parameters

key_id
Required
string

The 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

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

Sign in to use the interactive API playground
GET
/api/api-keys/:key_id

Revoke API Key

DELETE
/api/api-keys/:key_id

Revoke an API key

Permanently revokes an API key. This action cannot be undone. Any applications using this key will immediately lose access.

Parameters

key_id
Required
string

The 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

Success Response
// Returns 204 No Content on success

Try it out

Sign in to use the interactive API playground
DELETE
/api/api-keys/:key_id

Rotate API Key

POST
/api/api-keys/:key_id?action=rotate

Rotate 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_id
Required
string

The unique identifier of the API key to rotate

action
Required
string

Must 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

Response (200 OK)
{
  "api_key": "sk_live_new_key_xyz789...",
  "api_key_id": "new-key-uuid-here"
}

Try it out

Sign in to use the interactive API playground
POST
/api/api-keys/:key_id?action=rotate