Get API key

GET /v1/api-key

Describes the calling API key.

Answers with the key's id, scopes and expiry, and the service identity and organisation it acts for. Needs no scope, so an integration can check its key before it starts.

Authentication

Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work

Any API key can call this operation; it needs no scope.

Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)

Responses

  • 200 application/json ApiKeyInfo

    The calling key: its id, scopes and expiry, and the service identity and organisation it acts for

  • 401 application/json ErrorBody

    unauthenticated: the key is malformed, unknown, revoked or expired, or its service identity is disabled

  • 403 application/json ErrorBody

    api_key_required: the caller is signed in as a person, not with an API key

  • 429 application/json ErrorBody

    rate_limited: the key's requests per minute are used up (Retry-After)

  • 500 application/json ErrorBody

    internal

  • 503 application/json ErrorBody

    unavailable: the database is briefly unavailable; retry after Retry-After seconds

Error codes

Errors come back as an ErrorBody whose code is one of these.

  • 401 unauthenticated
  • 403 api_key_required
  • 429 rate_limited
  • 500 internal
  • 503 unavailable

Examples

curl
curl "$IVY_API_URL/v1/api-key" \
  -H "Authorization: Bearer $IVY_API_KEY"
JavaScript SDK
import { client, getApiKey } from "@spacivapp/ivy-sdk";

client.setConfig({
  baseUrl: process.env.IVY_API_URL,
  headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});

const { data, error, response } = await getApiKey();
Example response (200)
{
  "expires_at": "2026-01-15T09:30:00Z",
  "key_id": "key_123",
  "name": "Ada Lovelace",
  "organisation_id": "organisation_123",
  "scopes": [
    "workspaces:read"
  ],
  "service_identity_id": "service_identity_123",
  "service_identity_name": "Ada Lovelace"
}