{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amigo/main/json-schema/amigo-upsert-request-schema.json",
  "title": "UpsertRequest",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amigo-external-role-assignments-api-openapi.yml#/components/schemas/UpsertRequest",
  "properties": {
    "source": {
      "type": "string",
      "maxLength": 128,
      "minLength": 1,
      "title": "Source"
    },
    "external_subject_key": {
      "type": "string",
      "maxLength": 512,
      "minLength": 1,
      "title": "External Subject Key"
    },
    "external_subject_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ],
      "title": "External Subject Id"
    },
    "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ],
      "title": "Display Name"
    },
    "roles": {
      "items": {
        "type": "string",
        "maxLength": 64,
        "minLength": 1,
        "pattern": "^[a-z][a-z0-9_]{0,63}$"
      },
      "type": "array",
      "maxItems": 64,
      "title": "Roles"
    },
    "roles_verified": {
      "type": "boolean",
      "title": "Roles Verified",
      "default": false
    },
    "provisioned_via": {
      "type": "string",
      "enum": [
        "roster_sync",
        "jit"
      ],
      "title": "Provisioned Via"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "source",
    "external_subject_key",
    "entity_id",
    "provisioned_via"
  ]
}