Skip to main content
POST
/
api_keys
Create API Key
curl --request POST \
  --url https://api.example.com/api_keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "scopes": [
    {
      "resource_id": "<string>",
      "resource_type": "<string>",
      "role": "discoverer"
    }
  ],
  "sharing_group_ids": [
    "<string>"
  ],
  "description": "<string>"
}
'
{
  "api_key": {
    "created_by": "<string>",
    "id": "<string>",
    "key_prefix": "<string>",
    "name": "<string>",
    "org_id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "description": "<string>",
    "last_used_at": "2023-11-07T05:31:56Z",
    "revoked_at": "2023-11-07T05:31:56Z",
    "scopes": [
      {
        "resource_id": "<string>",
        "resource_type": "<string>",
        "role": "discoverer"
      }
    ],
    "sharing_group_ids": [
      "<string>"
    ]
  },
  "key": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.terminaluse.com/llms.txt

Use this file to discover all available pages before exploring further.

Store the returned api_key securely - it will not be shown again.

Body

application/json

Request model for creating an API key.

name
string
required

Human-readable name for the API key.

Required string length: 1 - 256
scopes
ApiKeyScope · object[]
required

List of resource scopes. At least one scope is required.

Minimum array length: 1
sharing_group_ids
string[]
required

IDs of groups that receive default admin grants on key-created resources.

Minimum array length: 1
description
string | null

Optional description.

Maximum string length: 1000

Response

Successful Response

Response model for API key creation.

Includes the full API key (shown only once).

api_key
ApiKeyResponse · object
required

The created API key metadata.

key
string
required

The full API key. Store securely - it will NOT be shown again.