{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amigo/main/json-schema/amigo-create-api-key-request-schema.json",
  "title": "CreateApiKeyRequest",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amigo-api-keys-api-openapi.yml#/components/schemas/CreateApiKeyRequest",
  "properties": {
    "name": {
      "anyOf": [
        {
          "$ref": "#/$defs/NameString"
        },
        {
          "type": "null"
        }
      ]
    },
    "duration_days": {
      "type": "integer",
      "maximum": 90.0,
      "minimum": 1.0,
      "title": "Duration Days"
    },
    "role": {
      "type": "string",
      "maxLength": 64,
      "title": "Role",
      "default": "member"
    },
    "permissions": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "maxItems": 128,
      "title": "Permissions",
      "description": "Permission names. Max 128 entries; each entry up to 128 chars."
    }
  },
  "type": "object",
  "required": [
    "duration_days"
  ],
  "$defs": {
    "NameString": {
      "type": "string",
      "maxLength": 256,
      "minLength": 1
    }
  }
}