{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amigo/main/json-schema/amigo-src-app-endpoints-organization-create-api-key-request-schema.json",
  "title": "Request",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amigo-organization-api-openapi.yml#/components/schemas/src__app__endpoints__organization__create_api_key__Request",
  "properties": {
    "name": {
      "anyOf": [
        {
          "$ref": "#/$defs/amigo_lib__pydantic__base_model__StrippedNonemptyString__1"
        },
        {
          "type": "null"
        }
      ],
      "description": "An optional name for the API key for easier identification by users."
    },
    "duration": {
      "type": "string",
      "format": "duration",
      "title": "Duration",
      "description": "The valid duration of the API key. Should be supplied in the [ISO8601 format](https://en.wikipedia.org/wiki/ISO_8601#Durations). Must be between 1 to 90 days."
    },
    "role_name": {
      "type": "string",
      "title": "Role Name",
      "description": "The name of the role associated with the key. When using this API key to authenticate, it can only authenticate for users with roles that are less permissive\nthan this role.",
      "default": "DefaultAdministratorRole"
    }
  },
  "type": "object",
  "required": [
    "name",
    "duration"
  ],
  "$defs": {
    "amigo_lib__pydantic__base_model__StrippedNonemptyString__1": {
      "type": "string",
      "minLength": 1
    }
  }
}