{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/componecat-ai/json-schema/componecat-ai-create-federation-request-schema.json",
  "title": "CreateFederationRequest",
  "description": "Request body for registering a federated identity trust. The service account comes from the route.\nstring? CreateFederationRequest.MetadataAddress is supplied only when the organization is bringing its own issuer and\nits discovery document is not at the issuer's well-known path. string? CreateFederationRequest.Assertion is a fresh,\nissuer-signed proof token the workload mints for exactly this (issuer, subject, audience); it is\nrequired for a self-registered issuer (and for an operator issuer that requires proof of possession).",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/componecat-ai-openapi.yml#/components/schemas/CreateFederationRequest",
  "required": [
    "name",
    "issuer",
    "subject",
    "audience",
    "scopes",
    "expiresInDays"
  ],
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "issuer": {
      "type": "string"
    },
    "subject": {
      "type": "string"
    },
    "audience": {
      "type": "string"
    },
    "scopes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CredentialScopeRequest"
      }
    },
    "expiresInDays": {
      "pattern": "^-?(?:0|[1-9]\\d*)$",
      "type": [
        "integer",
        "string"
      ],
      "format": "int32"
    },
    "metadataAddress": {
      "type": [
        "null",
        "string"
      ]
    },
    "assertion": {
      "type": [
        "null",
        "string"
      ]
    }
  },
  "$defs": {
    "CredentialScopeRequest": {
      "required": [
        "resource",
        "access",
        "canCreate"
      ],
      "type": "object",
      "properties": {
        "resource": {
          "type": "string"
        },
        "access": {
          "type": "string"
        },
        "canCreate": {
          "type": [
            "null",
            "boolean"
          ]
        }
      },
      "description": "A scope grant supplied when issuing a credential. string CredentialScopeRequest.Access is `none`,\n`read`, or `write` (any casing is accepted)."
    }
  }
}