Skip to main content
POST
/
api
/
vm
/
api-keys
Create Vm Api Key
curl --request POST \
  --url https://api.getgranite.ai/api/vm/api-keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "key_label": "<string>",
  "prefix": "<string>",
  "description": "<string>"
}
'
{
  "api_key": {
    "vm_api_key_id": "<string>",
    "key_label": "<string>",
    "status": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "key_prefix": "<string>",
    "key_last_four": "<string>",
    "last_used_at": "2023-11-07T05:31:56Z",
    "last_used_ip": "<string>",
    "machine_count": 0,
    "last_machine_seen_at": "2023-11-07T05:31:56Z"
  },
  "plaintext_key": "<string>"
}

Body

application/json
key_label
string
required

Human-friendly name for the API key

prefix
string | null

Optional key prefix

description
string | null

Optional metadata description

Response

Successful Response

Response containing the stored metadata and plaintext key.

api_key
VmApiKeyResponse · object
required

Stored key metadata

plaintext_key
string
required

Plaintext API key (only returned once)