{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/exactlane-dev/json-schema/exactlane-dev-public-access-grant-response-schema.json",
  "title": "PublicAccessGrantResponse",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/exactlane-dev-api-openapi.json#/components/schemas/PublicAccessGrantResponse",
  "additionalProperties": false,
  "properties": {
    "access": {
      "$ref": "#/$defs/PublicAccessDescriptor"
    },
    "agent": {
      "$ref": "#/$defs/Principal"
    },
    "credential": {
      "description": "Present only on the original 201; omitted or null on replay",
      "oneOf": [
        {
          "$ref": "#/$defs/BearerCredential"
        },
        {
          "type": "null"
        }
      ]
    },
    "credential_disclosure": {
      "const": "once"
    }
  },
  "required": [
    "agent",
    "access",
    "credential_disclosure"
  ],
  "type": "object",
  "$defs": {
    "BearerCredential": {
      "additionalProperties": false,
      "properties": {
        "token": {
          "description": "Returned in this response; only a digest is stored",
          "type": "string"
        },
        "type": {
          "const": "Bearer"
        }
      },
      "required": [
        "type",
        "token"
      ],
      "type": "object"
    },
    "Principal": {
      "additionalProperties": false,
      "properties": {
        "access_kind": {
          "enum": [
            "bootstrap",
            "public_preview"
          ],
          "type": "string"
        },
        "created_at": {
          "format": "date-time",
          "type": "string"
        },
        "display_label": {
          "type": "string"
        },
        "expires_at": {
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": "string"
        },
        "operator_group_ref": {
          "type": [
            "string",
            "null"
          ]
        },
        "revoked_at": {
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "scopes": {
          "items": {
            "enum": [
              "capabilities:write",
              "capabilities:read",
              "checks:write",
              "checks:read",
              "usage:write",
              "self:delete"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "traffic_class": {
          "enum": [
            "CONTROLLED",
            "EXTERNAL_REVIEWED",
            "UNKNOWN"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "display_label",
        "scopes",
        "traffic_class",
        "access_kind",
        "created_at",
        "expires_at",
        "revoked_at"
      ],
      "type": "object"
    },
    "PublicAccessDescriptor": {
      "additionalProperties": false,
      "properties": {
        "expires_at": {
          "format": "date-time",
          "type": "string"
        },
        "kind": {
          "const": "public_preview"
        },
        "lifetime_seconds": {
          "const": 1800,
          "type": "integer"
        },
        "notes": {
          "type": "string"
        },
        "quotas": {
          "additionalProperties": false,
          "properties": {
            "capabilities": {
              "const": 2,
              "type": "integer"
            },
            "checks": {
              "const": 3,
              "type": "integer"
            },
            "usage_events": {
              "const": 2,
              "type": "integer"
            }
          },
          "required": [
            "capabilities",
            "checks",
            "usage_events"
          ],
          "type": "object"
        },
        "scopes": {
          "items": {
            "enum": [
              "capabilities:write",
              "capabilities:read",
              "checks:write",
              "checks:read",
              "usage:write",
              "self:delete"
            ],
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "kind",
        "lifetime_seconds",
        "expires_at",
        "quotas",
        "scopes",
        "notes"
      ],
      "type": "object"
    }
  }
}