{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/2x/json-schema/2x-apikey-create-schema.json",
  "title": "APIKeyCreate",
  "description": "Request model for creating an API key.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/2x-api-keys-api-openapi.yml#/components/schemas/APIKeyCreate",
  "properties": {
    "customer_id": {
      "type": "string",
      "title": "Customer Id",
      "description": "Customer ID the key is scoped to"
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Friendly name for the API key"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description",
      "description": "Optional description"
    },
    "scope": {
      "$ref": "#/$defs/APIKeyScope",
      "description": "Access scope",
      "default": "read_only"
    },
    "expires_days": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expires Days",
      "description": "Number of days until expiration (None = no expiration)"
    }
  },
  "type": "object",
  "required": [
    "customer_id",
    "name"
  ],
  "$defs": {
    "APIKeyScope": {
      "type": "string",
      "enum": [
        "read_only"
      ],
      "title": "APIKeyScope",
      "description": "API key access scope - ALL KEYS ARE READ-ONLY"
    }
  }
}