TrieOH
IdentityXAPIApikeys

Create an API key

Creates an API key bound to a subject (actor) in the project, optionally scoped to a set of capability IDs and an expiry. The full raw key is returned exactly once in `data.raw_key` — store it, it cannot be retrieved again. The authenticated actor must be a platform-level client.

POST/projects/{project_id}/api_keys

Creates an API key bound to a subject (actor) in the project, optionally scoped to a set of capability IDs and an expiry. The full raw key is returned exactly once in data.raw_key — store it, it cannot be retrieved again. The authenticated actor must be a platform-level client.

Authorization

AuthorizationBearer <token>

JWT issued by IdentityX, signed with Ed25519

In: header

Path Parameters

project_id*string

Project ID.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for API key creation. Mirrors models.CreateAPIKeyRequest.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/api_keys" \  -H "Content-Type: application/json" \  -d '{    "subject_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",    "capabilities": [      "3fa85f64-5717-4562-b3fc-2c963f66afa7"    ],    "name": "checkout-prod",    "env": "production",    "expires_at": "2027-01-01T00:00:00Z"  }'
{
  "key": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",
    "name": "string",
    "display_prefix": "string",
    "metadata": {},
    "expires_at": "2019-08-24T14:15:22Z",
    "revoked_at": "2019-08-24T14:15:22Z",
    "last_used_at": "2019-08-24T14:15:22Z",
    "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
    "created_at": "2019-08-24T14:15:22Z"
  },
  "raw_key": "string"
}
{
  "detail": "string",
  "instance": "../dictionary",
  "errors": [
    {
      "field": "string",
      "message": "string"
    }
  ],
  "type": "http://example.com",
  "status": 400,
  "title": "Validation Failed"
}
{
  "detail": "string",
  "instance": "../dictionary",
  "errors": [
    {
      "field": "string",
      "message": "string"
    }
  ],
  "type": "http://example.com",
  "status": 401,
  "title": "Unauthenticated"
}
{
  "detail": "string",
  "instance": "../dictionary",
  "errors": [
    {
      "field": "string",
      "message": "string"
    }
  ],
  "type": "http://example.com",
  "status": 404,
  "title": "Not Found"
}
{
  "detail": "string",
  "instance": "../dictionary",
  "errors": [
    {
      "field": "string",
      "message": "string"
    }
  ],
  "type": "http://example.com",
  "status": 500,
  "title": "Internal Server Error"
}
{
  "detail": "string",
  "instance": "../dictionary",
  "errors": [
    {
      "field": "string",
      "message": "string"
    }
  ],
  "type": "http://example.com",
  "status": 503,
  "title": "Identity Unavailable"
}