{
  "openapi": "3.1.0",
  "info": {
    "title": "ADH Backend",
    "version": "0.0.0",
    "description": "Generated from the Drizzle schema. CRUD routes are derived per table (/<schema>/<resource>); the non-CRUD surface (auth, oauth, chat, registry, customer, storage, search, messaging, notifications, and more) is hand-written in src/openapi/paths/* and kept in sync with the routes by a drift guard."
  },
  "tags": [
    {
      "name": "access"
    },
    {
      "name": "account"
    },
    {
      "name": "announcements"
    },
    {
      "name": "audience"
    },
    {
      "name": "auth"
    },
    {
      "name": "billing"
    },
    {
      "name": "blocks"
    },
    {
      "name": "bookmarks"
    },
    {
      "name": "bucket"
    },
    {
      "name": "chat"
    },
    {
      "name": "community"
    },
    {
      "name": "contacts"
    },
    {
      "name": "content"
    },
    {
      "name": "customer"
    },
    {
      "name": "discussion"
    },
    {
      "name": "document"
    },
    {
      "name": "ecosystem"
    },
    {
      "name": "follows"
    },
    {
      "name": "friends"
    },
    {
      "name": "game"
    },
    {
      "name": "gamification"
    },
    {
      "name": "integration"
    },
    {
      "name": "integrations"
    },
    {
      "name": "interactions"
    },
    {
      "name": "messaging"
    },
    {
      "name": "mfa"
    },
    {
      "name": "monitoring"
    },
    {
      "name": "notes"
    },
    {
      "name": "notifications"
    },
    {
      "name": "oauth"
    },
    {
      "name": "persona"
    },
    {
      "name": "persona_memory"
    },
    {
      "name": "personal"
    },
    {
      "name": "presence"
    },
    {
      "name": "processing"
    },
    {
      "name": "project"
    },
    {
      "name": "public"
    },
    {
      "name": "registries"
    },
    {
      "name": "registry"
    },
    {
      "name": "search"
    },
    {
      "name": "settings"
    },
    {
      "name": "shipr"
    },
    {
      "name": "storage"
    },
    {
      "name": "sync"
    },
    {
      "name": "system"
    },
    {
      "name": "team"
    },
    {
      "name": "themes"
    },
    {
      "name": "tokens"
    },
    {
      "name": "usage"
    }
  ],
  "servers": [
    {
      "url": "https://api.agenticdeveloperhub.com",
      "description": "production"
    },
    {
      "url": "https://testing.api.agenticdeveloperhub.com",
      "description": "testing"
    },
    {
      "url": "http://localhost:3000",
      "description": "local"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "owned": {
                "type": "array",
                "description": "present when code is still_owns_data: the tables still owned, with counts",
                "items": {
                  "type": "object",
                  "required": [
                    "table",
                    "rows"
                  ],
                  "properties": {
                    "table": {
                      "type": "string"
                    },
                    "rows": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "User": {
        "type": "object",
        "required": [
          "id",
          "email",
          "name",
          "avatarUrl",
          "slug",
          "publicProfileEnabled",
          "profileVisibility",
          "capabilities"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "avatarUrl": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "nullable": true
          },
          "publicProfileEnabled": {
            "type": "boolean",
            "description": "Whether the public profile card is visible at /public/users/:slug"
          },
          "profileVisibility": {
            "type": "string",
            "enum": [
              "public",
              "hub",
              "private"
            ],
            "description": "The principal's page-level profile visibility. Supersedes publicProfileEnabled, which is retained during the expand phase and written in parallel."
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CustomerMe": {
        "type": "object",
        "required": [
          "user",
          "ecosystemId",
          "realm"
        ],
        "properties": {
          "user": {
            "type": "object",
            "required": [
              "id",
              "email",
              "name",
              "avatarUrl"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "email": {
                "type": "string",
                "nullable": true
              },
              "name": {
                "type": "string",
                "nullable": true
              },
              "avatarUrl": {
                "type": "string",
                "nullable": true,
                "description": "Customers carry no avatar today; always null."
              }
            }
          },
          "ecosystemId": {
            "type": "string",
            "description": "The ecosystem the customer belongs to"
          },
          "realm": {
            "type": "string",
            "enum": [
              "customer"
            ]
          }
        }
      },
      "AuthResult": {
        "type": "object",
        "required": [
          "token",
          "refreshToken",
          "user"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "JWT access token (Bearer credential)"
          },
          "refreshToken": {
            "type": "string",
            "description": "Opaque refresh token (rotated on use)"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          }
        }
      },
      "RefreshResult": {
        "type": "object",
        "required": [
          "token",
          "refreshToken"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "JWT access token (Bearer credential)"
          },
          "refreshToken": {
            "type": "string"
          }
        }
      },
      "MfaChallenge": {
        "type": "object",
        "required": [
          "mfaRequired",
          "token",
          "methods"
        ],
        "properties": {
          "mfaRequired": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "token": {
            "type": "string",
            "description": "Short-lived MFA pending token"
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sms",
                "totp",
                "webauthn",
                "recovery"
              ]
            },
            "description": "Second factors the user can satisfy"
          }
        }
      },
      "ApiToken": {
        "type": "object",
        "required": [
          "id",
          "name",
          "prefix",
          "createdAt",
          "expiresAt",
          "lastUsedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "description": "Non-secret leading chars, for display"
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "nullable": true
          },
          "lastUsedAt": {
            "type": "string",
            "nullable": true
          },
          "scope": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "REST path prefixes this token may reach (e.g. [\"/content/markdown\"], optional \":read\" suffix, \"*\" = all). null = legacy curated-only."
          }
        }
      },
      "ApiTokenCreated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ApiToken"
          },
          {
            "type": "object",
            "required": [
              "token"
            ],
            "properties": {
              "token": {
                "type": "string",
                "description": "The raw token value — shown exactly once"
              }
            }
          }
        ]
      },
      "AiProcessingProviderKind": {
        "type": "string",
        "enum": [
          "local",
          "openai",
          "anthropic",
          "gemini"
        ]
      },
      "AiProcessingLogLevel": {
        "type": "string",
        "enum": [
          "debug",
          "info",
          "warn",
          "error"
        ]
      },
      "AiProcessingConfigSetParams": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          },
          "maxOutputTokens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200000
          },
          "timeoutMs": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 600000
          },
          "outputMode": {
            "type": "string",
            "enum": [
              "schema",
              "json"
            ]
          }
        }
      },
      "AiProcessingWebhookEndpoint": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "customerId",
          "url",
          "eventTypes",
          "active",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "ecosystemId": {
            "type": "string",
            "description": "Ecosystem that owns this endpoint"
          },
          "customerId": {
            "type": "string",
            "description": "User who registered the endpoint"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "HTTPS-only delivery target URL"
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Subscribed event types (e.g. job.succeeded, job.failed)"
          },
          "active": {
            "type": "boolean",
            "description": "Whether the endpoint receives deliveries"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Human-readable label"
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "updatedAt": {
            "type": "string",
            "description": "ISO 8601 timestamp of last modification"
          }
        }
      },
      "AiProcessingWebhookEndpointCreated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AiProcessingWebhookEndpoint"
          },
          {
            "type": "object",
            "required": [
              "secret"
            ],
            "properties": {
              "secret": {
                "type": "string",
                "description": "whsec_-prefixed Standard Webhooks signing secret — returned exactly once. Store it; it cannot be retrieved again."
              }
            }
          }
        ]
      },
      "AiProcessingWebhookDelivery": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "endpointId",
          "eventId",
          "eventType",
          "payload",
          "status",
          "attempts",
          "maxAttempts",
          "nextAttemptAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "ecosystemId": {
            "type": "string"
          },
          "endpointId": {
            "type": "string",
            "format": "uuid"
          },
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "eventType": {
            "type": "string"
          },
          "payload": {
            "type": "object",
            "additionalProperties": true
          },
          "status": {
            "type": "string",
            "description": "pending | delivered | failed | dead"
          },
          "attempts": {
            "type": "integer"
          },
          "maxAttempts": {
            "type": "integer"
          },
          "nextAttemptAt": {
            "type": "string"
          },
          "responseStatus": {
            "type": "integer",
            "nullable": true
          },
          "lastError": {
            "type": "string",
            "nullable": true
          },
          "deliveredAt": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "AiProcessingJobLlm": {
        "type": "object",
        "required": [
          "configSetId",
          "configSetName",
          "provider",
          "model",
          "baseUrl",
          "connection",
          "apiKey",
          "params"
        ],
        "properties": {
          "configSetId": {
            "type": "string",
            "nullable": true,
            "description": "Null = no config set applies"
          },
          "configSetName": {
            "type": "string",
            "nullable": true
          },
          "provider": {
            "$ref": "#/components/schemas/AiProcessingProviderKind"
          },
          "model": {
            "type": "string",
            "description": "'' for a local target with no config set: the node uses its own default model"
          },
          "baseUrl": {
            "type": "string",
            "nullable": true,
            "description": "Null for local targets"
          },
          "connection": {
            "type": "object",
            "nullable": true,
            "description": "Non-secret connection shape only; null for local sets and services with no spec",
            "properties": {
              "auth": {
                "description": "How the node authenticates to the provider (no credential)"
              },
              "defaultQuery": {
                "description": "Query parameters the provider call always carries"
              }
            }
          },
          "apiKey": {
            "type": "string",
            "nullable": true,
            "description": "The service's API key for a paid target; null for local"
          },
          "params": {
            "$ref": "#/components/schemas/AiProcessingConfigSetParams"
          }
        }
      },
      "AiProcessingClaimedJob": {
        "type": "object",
        "required": [
          "id",
          "jobType",
          "targetKind",
          "targetId",
          "payload",
          "claimedAt",
          "leaseExpiresAt",
          "leaseToken"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "jobType": {
            "type": "string",
            "description": "Discriminator for worker routing (e.g. categorize_and_tag)"
          },
          "targetKind": {
            "type": "string",
            "description": "Namespace of the target entity (e.g. content.markdown)"
          },
          "targetId": {
            "type": "string",
            "description": "UUID of the target entity"
          },
          "payload": {
            "type": "object",
            "additionalProperties": true,
            "description": "Arbitrary job-specific input"
          },
          "claimedAt": {
            "type": "string",
            "description": "Drizzle-read timestamp of when the job was claimed"
          },
          "leaseExpiresAt": {
            "type": "string",
            "description": "Drizzle-read timestamp when the lease expires"
          },
          "leaseToken": {
            "type": "string",
            "description": "Opaque lease token required for heartbeat / complete / fail"
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "description": "Prior failed or reaped runs of this job; this claim is attempt attempts + 1"
          },
          "llm": {
            "$ref": "#/components/schemas/AiProcessingJobLlm",
            "description": "The LLM target this job runs under (its config set, else the default set)"
          }
        }
      },
      "AiProcessingWorkerUsage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "model",
          "inputTokens",
          "outputTokens"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "The provider billed, as its API host (e.g. api.openai.com, localhost:11434)"
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Model id"
          },
          "inputTokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000
          },
          "outputTokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000
          },
          "cacheReadTokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000
          },
          "cacheWriteTokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000
          },
          "reasoningTokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000
          },
          "attempt": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "1-based; default 1"
          },
          "partial": {
            "type": "boolean",
            "description": "The call did not run to its end; with no tokens at all, the spend is unknown (unpriced)"
          }
        }
      },
      "AiProcessingJob": {
        "type": "object",
        "required": [
          "id",
          "jobType",
          "targetKind",
          "targetId",
          "status",
          "priority",
          "attempts",
          "maxAttempts",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "jobType": {
            "type": "string",
            "description": "Discriminator for worker routing (e.g. categorize_and_tag)"
          },
          "targetKind": {
            "type": "string",
            "description": "Namespace of the target entity (e.g. content.markdown)"
          },
          "targetId": {
            "type": "string",
            "description": "UUID of the target entity"
          },
          "status": {
            "type": "string",
            "description": "Current lifecycle status (queued | claimed | succeeded | dead)"
          },
          "priority": {
            "type": "integer",
            "description": "Higher value = claimed first; default 0"
          },
          "attempts": {
            "type": "integer",
            "description": "Number of claim attempts so far"
          },
          "maxAttempts": {
            "type": "integer",
            "description": "Maximum allowed claim attempts before dead-lettering"
          },
          "createdAt": {
            "type": "string",
            "description": "Timestamp when the job was enqueued"
          },
          "updatedAt": {
            "type": "string",
            "description": "Timestamp of the last status transition"
          }
        }
      },
      "AiProcessingConfigSet": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "service",
          "provider",
          "model",
          "params",
          "isDefault",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "service": {
            "type": "object",
            "nullable": true,
            "description": "The personas service this set calls; null = the node's local LLM",
            "required": [
              "id",
              "name",
              "providerKind"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "providerKind": {
                "type": "string"
              }
            }
          },
          "provider": {
            "$ref": "#/components/schemas/AiProcessingProviderKind"
          },
          "model": {
            "type": "string"
          },
          "params": {
            "$ref": "#/components/schemas/AiProcessingConfigSetParams"
          },
          "isDefault": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "AiProcessingConfigSetInput": {
        "type": "object",
        "required": [
          "name",
          "model"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "description": "Unique across config sets"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "serviceId": {
            "type": "string",
            "nullable": true,
            "maxLength": 36,
            "description": "A personas service id; null or absent = the node's local LLM"
          },
          "model": {
            "type": "string",
            "maxLength": 200,
            "description": "Required; for a service, one of its known models when it lists any"
          },
          "params": {
            "$ref": "#/components/schemas/AiProcessingConfigSetParams"
          }
        }
      },
      "AiProcessingNode": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "version",
          "host",
          "providers",
          "config",
          "online",
          "firstSeenAt",
          "lastSeenAt",
          "jobsCompleted",
          "jobsFailed"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "typescript",
              "swift"
            ]
          },
          "version": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AiProcessingProviderKind"
            }
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "Reported, non-secret"
          },
          "online": {
            "type": "boolean",
            "description": "last_seen_at is within the last 2 minutes"
          },
          "firstSeenAt": {
            "type": "string"
          },
          "lastSeenAt": {
            "type": "string"
          },
          "jobsCompleted": {
            "type": "integer"
          },
          "jobsFailed": {
            "type": "integer"
          }
        }
      },
      "AiProcessingNodeLog": {
        "type": "object",
        "required": [
          "id",
          "nodeId",
          "occurredAt",
          "receivedAt",
          "level",
          "event",
          "message",
          "jobId",
          "data"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "nodeId": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string"
          },
          "receivedAt": {
            "type": "string"
          },
          "level": {
            "$ref": "#/components/schemas/AiProcessingLogLevel"
          },
          "event": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "jobId": {
            "type": "string",
            "nullable": true
          },
          "data": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          }
        }
      },
      "AiProcessingNodeLogPage": {
        "type": "object",
        "required": [
          "entries",
          "nextBefore"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AiProcessingNodeLog"
            }
          },
          "nextBefore": {
            "type": "integer",
            "nullable": true,
            "description": "Pass as `before` for the next (older) page; null = no more"
          }
        }
      },
      "AiProcessingSettings": {
        "type": "object",
        "required": [
          "logRetentionDays"
        ],
        "properties": {
          "logRetentionDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          }
        }
      },
      "AiProcessingWorkerToken": {
        "type": "object",
        "required": [
          "id",
          "name",
          "prefix",
          "createdAt",
          "expiresAt",
          "lastUsedAt",
          "nodes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "description": "The first 12 characters, for recognising a token"
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "nullable": true
          },
          "lastUsedAt": {
            "type": "string",
            "nullable": true
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ids of the registered nodes that last registered with this token"
          }
        }
      },
      "AiProcessingWorkerTokenInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "TokenPrincipal": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "description",
          "prefix",
          "rdid",
          "bucketRdid",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "description": "Non-secret leading chars of the secret, for display"
          },
          "rdid": {
            "type": "string",
            "nullable": true,
            "description": "reverse-domain id, e.g. token.<owner-slug>.<name>; null if it has no canonical mapping"
          },
          "bucketRdid": {
            "type": "string",
            "nullable": true,
            "description": "the token’s own isolated bucket, e.g. storage.<owner-slug>.<name>; null if it has no canonical mapping"
          },
          "expiresAt": {
            "type": "string",
            "nullable": true
          },
          "lastUsedAt": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "TokenPrincipalCreated": {
        "type": "object",
        "required": [
          "id",
          "rdid",
          "slug",
          "description",
          "prefix",
          "bucketRdid",
          "token"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "rdid": {
            "type": "string",
            "description": "reverse-domain id, e.g. token.<owner-slug>.<name>"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "description": "Non-secret leading chars of the secret, for display"
          },
          "bucketRdid": {
            "type": "string",
            "description": "the token’s own isolated bucket, e.g. storage.<owner-slug>.<name>"
          },
          "token": {
            "type": "string",
            "description": "the raw `adh_…` secret — shown once, never again"
          }
        }
      },
      "IntegrationConnectFields": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        },
        "description": "The provider's declared config fields (configFields), keyed by field key; validated + split into the secret vs non-secret config against the spec."
      },
      "IntegrationActionMediaItem": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string"
          },
          "altText": {
            "type": "string"
          }
        }
      },
      "IntegrationActionFields": {
        "type": "object",
        "description": "Provider merge/custom fields — flat string, number, or boolean values",
        "additionalProperties": true
      },
      "ProblemDetails": {
        "type": "object",
        "required": [
          "title",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "URI identifying the problem type; 'about:blank' when unspecified"
          },
          "title": {
            "type": "string",
            "description": "Short, human-readable summary of the problem type"
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code, duplicated in the body"
          },
          "detail": {
            "type": "string",
            "description": "Explanation specific to this occurrence"
          },
          "instance": {
            "type": "string",
            "description": "URI reference for this occurrence (the request path)"
          }
        }
      },
      "IntegrationConnection": {
        "type": "object",
        "required": [
          "id",
          "provider",
          "serviceType",
          "status",
          "displayName",
          "username",
          "externalAccountId",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "provider": {
            "type": "string",
            "description": "Provider slug (e.g. google-calendar, github)"
          },
          "serviceType": {
            "type": "string",
            "description": "Service within the provider (e.g. calendar)"
          },
          "status": {
            "type": "string",
            "description": "active | error | revoked | pending"
          },
          "displayName": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "externalAccountId": {
            "type": "string",
            "description": "Provider-side account id"
          },
          "lastSyncAt": {
            "type": "string",
            "nullable": true,
            "description": "Last successful sync (null = never)"
          },
          "lastError": {
            "type": "string",
            "nullable": true,
            "description": "Last recorded sync error"
          },
          "createdAt": {
            "type": "string"
          },
          "syncSettings": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true,
            "description": "Caller-tunable sync settings (gmailLabelIds / redditSubreddits / …) — non-secret, returned so settings forms can prefill instead of blind-overwriting."
          }
        }
      },
      "IntegrationProvider": {
        "type": "object",
        "required": [
          "providerId",
          "displayName",
          "authMethod",
          "serviceTypes",
          "capabilities",
          "defaultPollIntervalMs",
          "subtitle",
          "description",
          "links",
          "testable"
        ],
        "properties": {
          "providerId": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "authMethod": {
            "type": "string",
            "enum": [
              "oauth",
              "oauth_instance",
              "plaid_link",
              "api_key",
              "app_password",
              "github_app"
            ]
          },
          "serviceTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "read | write | auth"
          },
          "defaultPollIntervalMs": {
            "type": "integer",
            "description": "Default minimum sync interval (ms)"
          },
          "configFields": {
            "type": "array",
            "description": "For api_key providers: declarative config/credential fields, rendered + validated identically at ecosystem and user scope (absent for OAuth-style providers).",
            "items": {
              "type": "object",
              "required": [
                "key",
                "label",
                "secret",
                "required"
              ],
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "secret": {
                  "type": "boolean"
                },
                "required": {
                  "type": "boolean"
                },
                "placeholder": {
                  "type": "string"
                }
              }
            }
          },
          "subtitle": {
            "type": "string",
            "description": "Short human category for the picker list + filter (e.g. Email, Social)"
          },
          "description": {
            "type": "string",
            "description": "What the service is and what enabling it does"
          },
          "links": {
            "type": "array",
            "description": "Out-links for the info card (homepage / docs / \"get your keys\")",
            "items": {
              "type": "object",
              "required": [
                "label",
                "url"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "testable": {
            "type": "boolean",
            "description": "Whether a saved config for this provider can be verified — a GitHub App, or a provider declaring a validation endpoint. DERIVED, not stored: it is the condition POST …/provider-configs/{configId}/test dispatches on, so a client can draw the Test button without keeping its own list of which providers have one."
          }
        }
      },
      "IntegrationGlobalConfig": {
        "type": "object",
        "required": [
          "providerId",
          "config",
          "hasSecret"
        ],
        "properties": {
          "providerId": {
            "type": "string"
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "Non-secret config: clientId, scopes, URLs, endpoints, credentialStyle"
          },
          "hasSecret": {
            "type": "boolean",
            "description": "Whether a client secret is stored (the value is never returned)"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "IntegrationProviderConfig": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "providerId",
          "name",
          "rdid",
          "config",
          "hasSecret"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "ecosystemId": {
            "type": "string",
            "description": "Ecosystem id (the RLS owner)"
          },
          "providerId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Human-facing instance name (drives the rdid leaf)"
          },
          "rdid": {
            "type": "string",
            "nullable": true,
            "description": "The reverse-domain id integration.<ecosystem-slug>.<name-slug> (addressable), or null when this row has no canonical mapping. NULLABLE RATHER THAN \"\" — the read paths attach the rdid with a second lookup that can legitimately come back empty (a row predating the mint, or one whose mapping an operator freed), and the empty string is a valid rdid-shaped value clients treat as one: keying rows on it collapses every unmapped config into a single identity. Fall back to `id` for row identity."
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "Non-secret config: clientId, scopes, URLs, endpoints, credentialStyle"
          },
          "hasSecret": {
            "type": "boolean",
            "description": "Whether a client secret is stored (the value is never returned)"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deliverabilityWebhook": {
            "nullable": true,
            "type": "object",
            "required": [
              "url",
              "secretHeader",
              "secret",
              "instruction"
            ],
            "properties": {
              "url": {
                "type": "string",
                "description": "Absolute URL to paste into Postmark"
              },
              "secretHeader": {
                "type": "string",
                "description": "Header Postmark must send this config's webhook secret in"
              },
              "secret": {
                "type": "string",
                "nullable": true,
                "description": "This config's own inbound webhook secret. Never shared between ecosystems. Null when none has been minted yet (a config predating the feature) — POST .../rotate-webhook-secret mints one."
              },
              "instruction": {
                "type": "string",
                "description": "One-line operator instruction"
              }
            },
            "description": "Postmark deliverability webhook registration details (postmark configs only)"
          }
        }
      },
      "IntegrationConnectRequest": {
        "oneOf": [
          {
            "title": "IntegrationConnectOAuth",
            "type": "object",
            "required": [
              "type",
              "providerId",
              "serviceType",
              "ecosystemId",
              "code",
              "redirectUri",
              "state"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "oauth"
                ]
              },
              "providerId": {
                "type": "string"
              },
              "serviceType": {
                "type": "string"
              },
              "ecosystemId": {
                "type": "string",
                "description": "Target ecosystem id (the caller must manage it)"
              },
              "code": {
                "type": "string",
                "description": "OAuth authorization code"
              },
              "redirectUri": {
                "type": "string"
              },
              "state": {
                "type": "string",
                "description": "The HMAC-signed state returned by the auth-url endpoint (CSRF)"
              }
            }
          },
          {
            "title": "IntegrationConnectApiKey",
            "type": "object",
            "required": [
              "type",
              "providerId",
              "serviceType",
              "ecosystemId",
              "fields"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "api_key"
                ]
              },
              "providerId": {
                "type": "string"
              },
              "serviceType": {
                "type": "string"
              },
              "ecosystemId": {
                "type": "string",
                "description": "Target ecosystem id (the caller must manage it)"
              },
              "fields": {
                "$ref": "#/components/schemas/IntegrationConnectFields"
              }
            }
          },
          {
            "title": "IntegrationConnectAppPassword",
            "type": "object",
            "required": [
              "type",
              "providerId",
              "serviceType",
              "ecosystemId",
              "identifier",
              "password"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "app_password"
                ]
              },
              "providerId": {
                "type": "string"
              },
              "serviceType": {
                "type": "string"
              },
              "ecosystemId": {
                "type": "string",
                "description": "Target ecosystem id (the caller must manage it)"
              },
              "identifier": {
                "type": "string"
              },
              "password": {
                "type": "string"
              },
              "instanceUrl": {
                "type": "string"
              }
            }
          },
          {
            "title": "IntegrationConnectPlaidLink",
            "type": "object",
            "required": [
              "type",
              "providerId",
              "serviceType",
              "ecosystemId",
              "publicToken"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "plaid_link"
                ]
              },
              "providerId": {
                "type": "string"
              },
              "serviceType": {
                "type": "string"
              },
              "ecosystemId": {
                "type": "string",
                "description": "Target ecosystem id (the caller must manage it)"
              },
              "publicToken": {
                "type": "string"
              }
            }
          },
          {
            "title": "IntegrationConnectOAuthInstance",
            "type": "object",
            "required": [
              "type",
              "providerId",
              "serviceType",
              "ecosystemId",
              "code",
              "state"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "oauth_instance"
                ]
              },
              "providerId": {
                "type": "string"
              },
              "serviceType": {
                "type": "string"
              },
              "ecosystemId": {
                "type": "string",
                "description": "Target ecosystem id (the caller must manage it)"
              },
              "code": {
                "type": "string"
              },
              "state": {
                "type": "string"
              }
            }
          },
          {
            "title": "IntegrationConnectGithubApp",
            "type": "object",
            "required": [
              "type",
              "providerId",
              "serviceType",
              "ecosystemId",
              "installationId",
              "state"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "github_app"
                ]
              },
              "providerId": {
                "type": "string"
              },
              "serviceType": {
                "type": "string"
              },
              "ecosystemId": {
                "type": "string",
                "description": "Target ecosystem id (the caller must manage it)"
              },
              "installationId": {
                "type": "string",
                "description": "The numeric installation id the provider redirects back with"
              },
              "state": {
                "type": "string",
                "description": "The HMAC-signed state returned by the install-url endpoint (CSRF)"
              }
            }
          }
        ]
      },
      "IntegrationActionRequest": {
        "oneOf": [
          {
            "title": "IntegrationActionSend",
            "type": "object",
            "description": "actionType=send — an outbound email; at least one body is required",
            "required": [
              "to",
              "subject"
            ],
            "properties": {
              "to": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "cc": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "bcc": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "subject": {
                "type": "string"
              },
              "bodyText": {
                "type": "string"
              },
              "bodyHtml": {
                "type": "string"
              }
            }
          },
          {
            "title": "IntegrationActionPost",
            "type": "object",
            "description": "actionType=post — an outbound social post; requires text or media",
            "properties": {
              "text": {
                "type": "string"
              },
              "media": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IntegrationActionMediaItem"
                }
              },
              "replyTo": {
                "type": "string"
              }
            }
          },
          {
            "title": "IntegrationActionSms",
            "type": "object",
            "description": "actionType=sms — an outbound text message (Twilio-style)",
            "required": [
              "to",
              "body"
            ],
            "properties": {
              "to": {
                "type": "string",
                "description": "E.164 phone number (e.g. +15551234567)"
              },
              "body": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          {
            "title": "IntegrationActionSubmit",
            "type": "object",
            "description": "actionType=submit — a Reddit-style subreddit submission; exactly one of url (link post) or non-empty text (self post) is required (an empty-string text counts as absent)",
            "required": [
              "subreddit",
              "title"
            ],
            "properties": {
              "subreddit": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_]{2,21}$",
                "description": "Subreddit name without the r/ prefix"
              },
              "title": {
                "type": "string",
                "maxLength": 300
              },
              "url": {
                "type": "string",
                "description": "Link post target (mutually exclusive with text)"
              },
              "text": {
                "type": "string",
                "description": "Self-post body (mutually exclusive with url)"
              }
            }
          },
          {
            "title": "IntegrationActionComment",
            "type": "object",
            "description": "actionType=comment — a Reddit reply (reuses the post shape); requires non-empty text and replyTo (a t1_/t3_ fullname); media is rejected by the handler",
            "properties": {
              "text": {
                "type": "string"
              },
              "media": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IntegrationActionMediaItem"
                }
              },
              "replyTo": {
                "type": "string",
                "description": "The t1_/t3_ fullname being replied to"
              }
            }
          },
          {
            "title": "IntegrationActionSubscribe",
            "type": "object",
            "description": "actionType=subscribe — add or update one contact on a newsletter audience; audienceId is the PROVIDER list id",
            "required": [
              "audienceId",
              "email"
            ],
            "properties": {
              "audienceId": {
                "type": "string",
                "minLength": 1,
                "description": "Provider list id"
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "firstName": {
                "type": "string"
              },
              "lastName": {
                "type": "string"
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "fields": {
                "$ref": "#/components/schemas/IntegrationActionFields"
              }
            }
          },
          {
            "title": "IntegrationActionUnsubscribe",
            "type": "object",
            "description": "actionType=unsubscribe — remove one contact from ONE audience; audienceId is required (a list-less unsubscribe would be global)",
            "required": [
              "audienceId",
              "email"
            ],
            "properties": {
              "audienceId": {
                "type": "string",
                "minLength": 1,
                "description": "Provider list id"
              },
              "email": {
                "type": "string",
                "format": "email"
              }
            }
          },
          {
            "title": "IntegrationActionBroadcast",
            "type": "object",
            "description": "actionType=broadcast — compose (but do NOT send) a broadcast to an audience; returns the broadcast id",
            "required": [
              "audienceId",
              "subject",
              "bodyHtml"
            ],
            "properties": {
              "audienceId": {
                "type": "string",
                "minLength": 1,
                "description": "Provider list id"
              },
              "subject": {
                "type": "string"
              },
              "fromName": {
                "type": "string"
              },
              "replyTo": {
                "type": "string",
                "format": "email"
              },
              "bodyHtml": {
                "type": "string",
                "minLength": 1
              },
              "bodyText": {
                "type": "string"
              }
            }
          },
          {
            "title": "IntegrationActionBroadcastSend",
            "type": "object",
            "description": "actionType=broadcast_send — dispatch a broadcast previously created by actionType=broadcast",
            "required": [
              "broadcastId"
            ],
            "properties": {
              "broadcastId": {
                "type": "string",
                "minLength": 1,
                "description": "The externalId returned by the broadcast action"
              }
            }
          },
          {
            "title": "IntegrationActionLabelCreate",
            "type": "object",
            "description": "actionType=label_create — gmail: create a label. A `Parent/Child` name nests it under Parent",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "labelListVisibility": {
                "$ref": "#/components/schemas/IntegrationGmailLabelListVisibility"
              },
              "messageListVisibility": {
                "$ref": "#/components/schemas/IntegrationGmailMessageListVisibility"
              },
              "color": {
                "$ref": "#/components/schemas/IntegrationGmailLabelColor"
              }
            }
          },
          {
            "title": "IntegrationActionLabelUpdate",
            "type": "object",
            "description": "actionType=label_update — gmail: rename or restyle ONE label (children are not renamed); at least one field besides labelId is required",
            "required": [
              "labelId"
            ],
            "properties": {
              "labelId": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "labelListVisibility": {
                "$ref": "#/components/schemas/IntegrationGmailLabelListVisibility"
              },
              "messageListVisibility": {
                "$ref": "#/components/schemas/IntegrationGmailMessageListVisibility"
              },
              "color": {
                "$ref": "#/components/schemas/IntegrationGmailLabelColor"
              }
            }
          },
          {
            "title": "IntegrationActionLabelDelete",
            "type": "object",
            "description": "actionType=label_delete — gmail: delete one label",
            "required": [
              "labelId"
            ],
            "properties": {
              "labelId": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          {
            "title": "IntegrationActionModifyLabels",
            "type": "object",
            "description": "actionType=modify_labels — gmail: add and/or remove labels on 1 to 1000 messages; at least one of addLabelIds or removeLabelIds must be non-empty",
            "required": [
              "messageIds"
            ],
            "properties": {
              "messageIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 1,
                "maxItems": 1000
              },
              "addLabelIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "removeLabelIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          {
            "title": "IntegrationActionAlbumCreate",
            "type": "object",
            "description": "actionType=album_create — google-photos: create an app-created album",
            "required": [
              "title"
            ],
            "properties": {
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              }
            }
          },
          {
            "title": "IntegrationActionAlbumUpdate",
            "type": "object",
            "description": "actionType=album_update — google-photos: rename and/or set the cover of an app-created album; title or coverPhotoMediaItemId is required",
            "required": [
              "albumId"
            ],
            "properties": {
              "albumId": {
                "type": "string",
                "minLength": 1
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              "coverPhotoMediaItemId": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          {
            "title": "IntegrationActionAlbumRemoveItems",
            "type": "object",
            "description": "actionType=album_remove_items — google-photos: take app-created items out of an app-created album (1 to 50 ids)",
            "required": [
              "albumId",
              "mediaItemIds"
            ],
            "properties": {
              "albumId": {
                "type": "string",
                "minLength": 1
              },
              "mediaItemIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 1,
                "maxItems": 50
              }
            }
          },
          {
            "title": "IntegrationActionUpload",
            "type": "object",
            "description": "actionType=upload — google-photos: turn an upload token (from the uploads route) into a media item, optionally inside an album",
            "required": [
              "uploadToken",
              "fileName"
            ],
            "properties": {
              "uploadToken": {
                "type": "string",
                "minLength": 1
              },
              "albumId": {
                "type": "string",
                "minLength": 1
              },
              "fileName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "description": {
                "type": "string",
                "maxLength": 1000
              }
            }
          },
          {
            "title": "IntegrationActionImportPicked",
            "type": "object",
            "description": "actionType=import_picked — google-photos: copy one page (50 items) of a finished Picker session into an album; repeat with the next pageToken",
            "required": [
              "sessionId",
              "albumId"
            ],
            "properties": {
              "sessionId": {
                "type": "string",
                "minLength": 1
              },
              "albumId": {
                "type": "string",
                "minLength": 1
              },
              "pageToken": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        ]
      },
      "IntegrationGmailLabelListVisibility": {
        "type": "string",
        "enum": [
          "labelShow",
          "labelShowIfUnread",
          "labelHide"
        ]
      },
      "IntegrationGmailMessageListVisibility": {
        "type": "string",
        "enum": [
          "show",
          "hide"
        ]
      },
      "IntegrationGmailLabelColor": {
        "type": "object",
        "required": [
          "textColor",
          "backgroundColor"
        ],
        "properties": {
          "textColor": {
            "type": "string"
          },
          "backgroundColor": {
            "type": "string"
          }
        }
      },
      "IntegrationMeProvider": {
        "type": "object",
        "required": [
          "providerId",
          "displayName",
          "authMethod",
          "serviceTypes",
          "capabilities"
        ],
        "properties": {
          "providerId": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "authMethod": {
            "type": "string"
          },
          "serviceTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "read | write | auth"
          }
        }
      },
      "IntegrationMeConnectRequest": {
        "type": "object",
        "required": [
          "type",
          "providerId",
          "serviceType"
        ],
        "additionalProperties": true,
        "description": "Same variants as IntegrationConnectRequest (matched on `type`), minus `ecosystemId`. `providerConfigId` is refused with 400.",
        "properties": {
          "type": {
            "type": "string",
            "description": "oauth | oauth_instance | api_key | app_password"
          },
          "providerId": {
            "type": "string"
          },
          "serviceType": {
            "type": "string"
          }
        }
      },
      "IntegrationMeActionResult": {
        "type": "object",
        "required": [
          "ok",
          "status",
          "actionLogId",
          "externalId",
          "deduped"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "error"
            ]
          },
          "actionLogId": {
            "type": "string"
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "deduped": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "result": {
            "description": "The action's raw result, when it returned one."
          }
        }
      },
      "IntegrationPickerSessionStart": {
        "type": "object",
        "required": [
          "sessionId",
          "pickerUri",
          "expireTime"
        ],
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "pickerUri": {
            "type": "string",
            "description": "Send the user here to choose photos."
          },
          "expireTime": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "IntegrationPickerSessionState": {
        "type": "object",
        "required": [
          "sessionId",
          "mediaItemsSet",
          "expireTime"
        ],
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "mediaItemsSet": {
            "type": "boolean",
            "description": "true once the user has finished choosing."
          },
          "expireTime": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "IntegrationConnectionDataPage": {
        "type": "object",
        "required": [
          "rows",
          "nextCursor"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "description": "Pass as `cursor` for the next page. null on the last page."
          }
        }
      },
      "IntegrationActionResult": {
        "type": "object",
        "required": [
          "ok",
          "status",
          "actionLogId",
          "externalId",
          "deduped"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "true when status is ok"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "error"
            ]
          },
          "actionLogId": {
            "type": "string",
            "description": "The integration_action_logs row id"
          },
          "externalId": {
            "type": "string",
            "nullable": true,
            "description": "Provider-side id produced, if any"
          },
          "deduped": {
            "type": "boolean",
            "description": "true when an Idempotency-Key replay returned a prior row"
          },
          "error": {
            "type": "string",
            "description": "Failure message when status is error"
          }
        }
      },
      "IntegrationTestResult": {
        "type": "object",
        "required": [
          "ok",
          "summary",
          "notes"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "Whether the provider accepted the credentials. false is an answer."
          },
          "summary": {
            "type": "string",
            "description": "One line, ready to show an operator — the provider's own refusal when ok is false."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Supporting detail: the accounts reached, the stated non-secret fields the answer was about, anything that succeeded partially."
          },
          "adopted": {
            "type": "object",
            "description": "GitHub App, saved config only. Testing a GitHub App IS adopting its installations — the only proof an app id and private key are real is to mint a JWT and enumerate what the app can see, and that enumeration is what creates the connections and warms the repository cache. So this field is the connect that just happened, reported.",
            "required": [
              "connected",
              "skipped"
            ],
            "properties": {
              "connected": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "installationId",
                    "accountLogin",
                    "targetType"
                  ],
                  "properties": {
                    "installationId": {
                      "type": "string"
                    },
                    "accountLogin": {
                      "type": "string",
                      "description": "The account the app is installed on — the org whose repositories it reaches."
                    },
                    "targetType": {
                      "type": "string",
                      "description": "`Organization` or `User`."
                    },
                    "connectionId": {
                      "type": "string",
                      "description": "The connection holding it — set when this call made one, AND when a previous call already had. Adoption is idempotent, so a second call over the same installations reports them connected rather than connecting them again."
                    },
                    "skipped": {
                      "type": "string",
                      "description": "Why it was not connected. Absent on success."
                    },
                    "warning": {
                      "type": "string",
                      "description": "The connection stands, and the prefetch that rides along behind it — caching what this installation was granted — did not finish. NOT a skip: everything that needs a connection works, and only the repository picker opening instantly does not. It is reported because this call is what the Test button runs, and a picker that will open empty should say so now rather than at the moment somebody needs it."
                    }
                  }
                }
              },
              "skipped": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "installationId",
                    "accountLogin",
                    "targetType"
                  ],
                  "properties": {
                    "installationId": {
                      "type": "string"
                    },
                    "accountLogin": {
                      "type": "string",
                      "description": "The account the app is installed on — the org whose repositories it reaches."
                    },
                    "targetType": {
                      "type": "string",
                      "description": "`Organization` or `User`."
                    },
                    "connectionId": {
                      "type": "string",
                      "description": "The connection holding it — set when this call made one, AND when a previous call already had. Adoption is idempotent, so a second call over the same installations reports them connected rather than connecting them again."
                    },
                    "skipped": {
                      "type": "string",
                      "description": "Why it was not connected. Absent on success."
                    },
                    "warning": {
                      "type": "string",
                      "description": "The connection stands, and the prefetch that rides along behind it — caching what this installation was granted — did not finish. NOT a skip: everything that needs a connection works, and only the repository picker opening instantly does not. It is reported because this call is what the Test button runs, and a picker that will open empty should say so now rather than at the moment somebody needs it."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "IntegrationTransferResult": {
        "type": "object",
        "required": [
          "config",
          "connections",
          "repositoryCaches"
        ],
        "properties": {
          "config": {
            "$ref": "#/components/schemas/IntegrationProviderConfig"
          },
          "connections": {
            "type": "integer",
            "description": "LIVE connections now in the destination — not how many rows moved. A soft-deleted connection travels with the config (its ecosystem column is what RLS reads) but is not a working account, so counting it would overstate what the operator now has."
          },
          "repositoryCaches": {
            "type": "integer",
            "description": "Cached repository lists that followed those connections."
          }
        }
      },
      "PublicInvitationRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "ecosystem": {
            "type": "string",
            "description": "Target ecosystem address (rdid or uuid). Absent = the hub. Unknown/deleted → 404."
          }
        }
      },
      "InviteVerifyRequest": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string"
          }
        }
      },
      "InviteVerifyResult": {
        "type": "object",
        "required": [
          "ok",
          "ecosystemName"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "ecosystemName": {
            "type": "string"
          }
        }
      },
      "InvitePreview": {
        "type": "object",
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "valid",
              "expired",
              "accepted",
              "invalid"
            ]
          },
          "ecosystemName": {
            "type": [
              "string",
              "null"
            ]
          },
          "maskedDestination": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "InviteAcceptRequest": {
        "type": "object",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string"
          }
        }
      },
      "InviteAcceptResult": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "verification_required"
            ]
          },
          "ecosystemName": {
            "type": "string"
          }
        }
      },
      "PendingUser": {
        "type": "object",
        "description": "A person known to the ecosystem who has not accepted an invitation yet.",
        "required": [
          "id",
          "ecosystemId",
          "userNumber",
          "name",
          "email",
          "phone",
          "status",
          "requestCount",
          "invitedCount",
          "lastRequestAt",
          "lastInviteSentAt",
          "firstRequestedAt",
          "lastSource",
          "lastNote",
          "acceptedCustomerId",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36
          },
          "ecosystemId": {
            "type": "string",
            "maxLength": 36
          },
          "userNumber": {
            "type": "integer",
            "description": "Sequential within the ecosystem, assigned on insert"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "maxLength": 255,
            "nullable": true
          },
          "phone": {
            "type": "string",
            "maxLength": 32,
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "invited",
              "accepted",
              "declined"
            ]
          },
          "requestCount": {
            "type": "integer"
          },
          "invitedCount": {
            "type": "integer"
          },
          "lastRequestAt": {
            "type": "string",
            "nullable": true
          },
          "lastInviteSentAt": {
            "type": "string",
            "nullable": true
          },
          "firstRequestedAt": {
            "type": "string"
          },
          "lastSource": {
            "type": "string",
            "maxLength": 120,
            "nullable": true
          },
          "lastNote": {
            "type": "string",
            "nullable": true
          },
          "acceptedCustomerId": {
            "type": "string",
            "maxLength": 36,
            "nullable": true
          },
          "contactId": {
            "type": "string",
            "maxLength": 36,
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "Invitation": {
        "type": "object",
        "description": "One invite delivered to one destination. Inviting by both email and SMS makes two.",
        "required": [
          "id",
          "ecosystemId",
          "pendingUserId",
          "name",
          "channel",
          "destination",
          "tokenHash",
          "status",
          "sentBy",
          "sentAt",
          "expiresAt",
          "acceptedAt",
          "acceptedCustomerId",
          "messageLogId",
          "adminNote",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36
          },
          "ecosystemId": {
            "type": "string",
            "maxLength": 36
          },
          "pendingUserId": {
            "type": "string",
            "maxLength": 36
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "destination": {
            "type": "string",
            "maxLength": 255
          },
          "tokenHash": {
            "type": "string",
            "maxLength": 64
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "registered",
              "accepted",
              "expired",
              "revoked"
            ]
          },
          "sentBy": {
            "type": "string",
            "maxLength": 36
          },
          "sentAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "acceptedAt": {
            "type": "string",
            "nullable": true
          },
          "acceptedCustomerId": {
            "type": "string",
            "maxLength": 36,
            "nullable": true
          },
          "messageLogId": {
            "type": "string",
            "maxLength": 36,
            "nullable": true
          },
          "adminNote": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "InvitationRequest": {
        "type": "object",
        "description": "An unsolicited ask to join, as captured by the public request form.",
        "required": [
          "id",
          "ecosystemId",
          "pendingUserId",
          "name",
          "email",
          "phone",
          "source",
          "note",
          "createdAt",
          "userNumber"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36
          },
          "ecosystemId": {
            "type": "string",
            "maxLength": 36
          },
          "pendingUserId": {
            "type": "string",
            "maxLength": 36
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "maxLength": 255,
            "nullable": true
          },
          "phone": {
            "type": "string",
            "maxLength": 32,
            "nullable": true
          },
          "source": {
            "type": "string",
            "maxLength": 120,
            "nullable": true
          },
          "note": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "userNumber": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "AddPendingUsersBody": {
        "type": "object",
        "required": [
          "users"
        ],
        "properties": {
          "users": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/AddPendingUser"
            }
          }
        }
      },
      "AddPendingUser": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 255
          },
          "phone": {
            "type": "string",
            "maxLength": 32
          },
          "note": {
            "type": "string"
          }
        }
      },
      "SendInvitesBody": {
        "type": "object",
        "description": "Names the people to invite and the channels to reach them on. At least one channel is required.",
        "required": [
          "pendingUserIds"
        ],
        "properties": {
          "pendingUserIds": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 36
            }
          },
          "email": {
            "$ref": "#/components/schemas/SendInviteChannel"
          },
          "sms": {
            "$ref": "#/components/schemas/SendInviteChannel"
          }
        }
      },
      "SendInviteChannel": {
        "type": "object",
        "description": "Send on this channel. `note` is added to the message body.",
        "properties": {
          "note": {
            "type": "string"
          }
        }
      },
      "Announcement": {
        "type": "object",
        "required": [
          "id",
          "createdBy",
          "title",
          "body",
          "audience",
          "status",
          "createdAt",
          "updatedAt",
          "sentAt",
          "totalRecipients",
          "sentCount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36
          },
          "createdBy": {
            "type": "string",
            "maxLength": 36
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "audience": {
            "type": "string",
            "description": "See AnnouncementCreate.audience"
          },
          "status": {
            "type": "string",
            "description": "e.g. sending, sent"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "sentAt": {
            "type": "string",
            "nullable": true,
            "description": "null until the fan-out finishes"
          },
          "totalRecipients": {
            "type": "integer"
          },
          "sentCount": {
            "type": "integer"
          }
        }
      },
      "AnnouncementList": {
        "type": "object",
        "required": [
          "announcements"
        ],
        "properties": {
          "announcements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Announcement"
            }
          }
        }
      },
      "AnnouncementCreate": {
        "type": "object",
        "required": [
          "title",
          "body"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1
          },
          "body": {
            "type": "string",
            "minLength": 1
          },
          "audience": {
            "type": "string",
            "default": "all_hub",
            "description": "Reserved for targeting. Stored and echoed back, but fan-out currently reaches every live customer of the ecosystem whatever this says — it is not yet an enum, and no value narrows the audience."
          }
        }
      },
      "AnnouncementAccepted": {
        "type": "object",
        "required": [
          "id",
          "recipientCount",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36
          },
          "recipientCount": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "sending"
            ]
          }
        }
      },
      "AuthUserMethod": {
        "type": "object",
        "required": [
          "id",
          "userId",
          "provider",
          "providerId",
          "hasCredential",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "providerId": {
            "type": "string",
            "nullable": true
          },
          "hasCredential": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "AuthMethodSetting": {
        "type": "object",
        "required": [
          "method",
          "enabled"
        ],
        "properties": {
          "method": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "PostmarkDeliverabilityEvent": {
        "type": "object",
        "required": [
          "RecordType"
        ],
        "properties": {
          "RecordType": {
            "type": "string",
            "description": "'Bounce' | 'SpamComplaint' | 'SubscriptionChange' | anything else (ignored)"
          },
          "Type": {
            "type": "string",
            "description": "e.g. 'HardBounce', 'SoftBounce', 'BadEmailAddress'"
          },
          "Email": {
            "type": "string"
          },
          "Recipient": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "SuppressSending": {
            "type": "boolean",
            "description": "Only meaningful on a 'SubscriptionChange' event: Postmark sends this both when an address ENTERS its suppression list (true) and when it LEAVES (false). Only true suppresses — acting on false would permanently silence a re-subscribe."
          }
        }
      },
      "SignupListPublic": {
        "type": "object",
        "required": [
          "name",
          "description",
          "status",
          "nonce",
          "minAgeMs"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ]
          },
          "minAgeMs": {
            "type": "integer",
            "description": "How long after this response a submit carrying the nonce is accepted. A client MUST wait it out: submitting sooner is rejected as an opaque `400 invalid submission`, and because a retry needs a fresh nonce, retrying promptly restarts the same clock indefinitely. Measure the delay from RECEIVING this response, not from a clock comparison — the deadline is server-side and client clocks are not trusted."
          },
          "nonce": {
            "type": "string",
            "description": "Round-trip anti-abuse token, bound to this publicKey. The submit must present it back; it is rejected if the signature does not verify, if it was minted for a different list, if it is older than its TTL, or if it is younger than the minimum form-fill age. NOT single-use: it is a signed timestamp with no server-side record, so the same nonce may be submitted repeatedly until its TTL expires. Clients must not rely on replay being refused; the per-IP cap, not the nonce, bounds volume."
          }
        }
      },
      "ListMember": {
        "type": "object",
        "required": [
          "id",
          "contactId",
          "email",
          "name",
          "deliveryStatus",
          "bounceCount",
          "status",
          "consentSourceUrl",
          "consentAt",
          "unsubscribedAt",
          "resubscribedAt",
          "unsubscribeCount",
          "emailsSentCount",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "the list_members row id"
          },
          "contactId": {
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveryStatus": {
            "type": "string",
            "enum": [
              "ok",
              "bounced",
              "complained",
              "suppressed"
            ]
          },
          "bounceCount": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "subscribed",
              "unsubscribed"
            ]
          },
          "consentSourceUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "consentAt": {
            "type": "string"
          },
          "unsubscribedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When they LAST unsubscribed. Durable — a later resubscribe never clears it, so a currently-subscribed member may carry one."
          },
          "resubscribedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When they last signed up again after unsubscribing. Null if they never did."
          },
          "unsubscribeCount": {
            "type": "integer",
            "description": "Opt-out transitions for this membership. A mailbox provider retrying the one-click unsubscribe does not increment it; a resubscribe does not reset it."
          },
          "emailsSentCount": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "ListStats": {
        "type": "object",
        "required": [
          "subscribed",
          "unsubscribed",
          "suppressed",
          "total"
        ],
        "properties": {
          "subscribed": {
            "type": "integer",
            "description": "subscribed AND currently mailable"
          },
          "unsubscribed": {
            "type": "integer"
          },
          "suppressed": {
            "type": "integer",
            "description": "subscribed but NOT mailable (deliveryStatus != 'ok' — bounced/complained/suppressed)"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "Campaign": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "listId",
          "name",
          "subject",
          "htmlBody",
          "textBody",
          "fromName",
          "status",
          "recipientCount",
          "sentCount",
          "failedCount",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "listId": {
            "type": "string"
          },
          "createdBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "htmlBody": {
            "type": "string"
          },
          "textBody": {
            "type": "string"
          },
          "fromName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "sending",
              "sent",
              "failed",
              "cancelled"
            ]
          },
          "scheduledAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "completedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipientCount": {
            "type": "integer"
          },
          "sentCount": {
            "type": "integer"
          },
          "failedCount": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "CampaignCreate": {
        "type": "object",
        "required": [
          "name",
          "subject",
          "htmlBody",
          "textBody"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "subject": {
            "type": "string",
            "maxLength": 500
          },
          "htmlBody": {
            "type": "string"
          },
          "textBody": {
            "type": "string"
          },
          "fromName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CampaignPatch": {
        "type": "object",
        "description": "All fields optional; only present on a campaign still in draft.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "subject": {
            "type": "string",
            "maxLength": 500
          },
          "htmlBody": {
            "type": "string"
          },
          "textBody": {
            "type": "string"
          },
          "fromName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Delivery": {
        "type": "object",
        "required": [
          "id",
          "email",
          "name",
          "status",
          "attempts",
          "lastError",
          "sentAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "sending",
              "sent",
              "failed",
              "skipped"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "TestSendBody": {
        "type": "object",
        "required": [
          "to"
        ],
        "properties": {
          "to": {
            "type": "string",
            "format": "email"
          }
        }
      },
      "SendResult": {
        "type": "object",
        "required": [
          "queued",
          "skipped"
        ],
        "properties": {
          "queued": {
            "type": "integer",
            "description": "deliveries materialized and left for the drain to send"
          },
          "skipped": {
            "type": "integer",
            "description": "members not queued (unsubscribed or undeliverable)"
          }
        }
      },
      "InviteResult": {
        "type": "object",
        "required": [
          "created",
          "skipped"
        ],
        "properties": {
          "created": {
            "type": "integer",
            "description": "new auth.pending_users rows created from this list"
          },
          "skipped": {
            "type": "integer",
            "description": "members already pending/invited, or undeliverable, so left untouched"
          }
        }
      },
      "RotateKeyResult": {
        "type": "object",
        "required": [
          "publicKey"
        ],
        "properties": {
          "publicKey": {
            "type": "string",
            "description": "the list's NEW embed key. The old key stops working immediately — any page still embedding it must be updated."
          }
        }
      },
      "BillingContext": {
        "type": "object",
        "required": [
          "ecosystemId",
          "billingEnabled",
          "canManage",
          "stripeStatus",
          "webhookPath"
        ],
        "properties": {
          "ecosystemId": {
            "type": "string"
          },
          "billingEnabled": {
            "type": "boolean"
          },
          "canManage": {
            "type": "boolean"
          },
          "stripeStatus": {
            "type": "string",
            "enum": [
              "connected",
              "not_connected",
              "unknown"
            ]
          },
          "webhookPath": {
            "type": "string"
          }
        }
      },
      "BillingEvent": {
        "type": "object",
        "required": [
          "id",
          "stripeEventId",
          "type",
          "receivedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "stripeEventId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "receivedAt": {
            "type": "string"
          },
          "processedAt": {
            "type": "string",
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "BillingAccount": {
        "type": "object",
        "required": [
          "id",
          "offerId",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "offerId": {
            "type": "string"
          },
          "stripeCustomerId": {
            "type": "string",
            "nullable": true
          },
          "stripeCheckoutSessionId": {
            "type": "string",
            "nullable": true
          },
          "stripeSubscriptionId": {
            "type": "string",
            "nullable": true
          },
          "payerEmail": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "currentPeriodEnd": {
            "type": "string",
            "nullable": true
          },
          "lapsedAt": {
            "type": "string",
            "nullable": true
          },
          "claimedCustomerId": {
            "type": "string",
            "nullable": true
          },
          "claimedAt": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "BillingResendClaim": {
        "type": "object",
        "required": [
          "ok",
          "accountId",
          "expiresAt"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "accountId": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          }
        }
      },
      "BillingPriceOption": {
        "type": "object",
        "required": [
          "id",
          "productId",
          "currency"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "productId": {
            "type": "string"
          },
          "productName": {
            "type": "string",
            "nullable": true
          },
          "unitAmount": {
            "type": "integer",
            "nullable": true
          },
          "currency": {
            "type": "string"
          },
          "interval": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "BillingRedriveResult": {
        "type": "object",
        "required": [
          "examined",
          "applied",
          "terminal",
          "stillPending",
          "unreadable",
          "failed",
          "nextOffset"
        ],
        "properties": {
          "examined": {
            "type": "integer"
          },
          "applied": {
            "type": "integer"
          },
          "terminal": {
            "type": "integer"
          },
          "stillPending": {
            "type": "integer"
          },
          "unreadable": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "nextOffset": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "BillingClaimRequest": {
        "type": "object",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "BillingClaimResult": {
        "type": "object",
        "required": [
          "ok",
          "ecosystemId",
          "offerId"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "ecosystemId": {
            "type": "string"
          },
          "offerId": {
            "type": "string"
          }
        }
      },
      "StripeWebhookEvent": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "created": {
            "type": "integer"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "BillingAck": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          }
        }
      },
      "BucketRow": {
        "type": "object",
        "additionalProperties": true,
        "description": "A bucket-table row. Intentionally open — the column set is defined at runtime by the developer-managed table this bucket points at, so no fixed property schema applies."
      },
      "BucketRowList": {
        "type": "object",
        "required": [
          "rows"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BucketRow"
            }
          }
        }
      },
      "BucketAccessGroup": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "bucketId",
          "name",
          "description",
          "kind",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string",
            "description": "owning ecosystem"
          },
          "bucketId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "'everyone' (seeded) or 'custom'"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "BucketAccessGroupMember": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "accessGroupId",
          "memberType",
          "memberId",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "accessGroupId": {
            "type": "string"
          },
          "memberType": {
            "type": "string",
            "enum": [
              "user",
              "organization",
              "persona",
              "app",
              "token"
            ]
          },
          "memberId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "BucketGrant": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "accessGroupId",
          "targetType",
          "targetId",
          "crud",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "accessGroupId": {
            "type": "string"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "bucket",
              "bucket_type"
            ]
          },
          "targetId": {
            "type": "string"
          },
          "crud": {
            "type": "string",
            "description": "comma-separated CRUD subset, e.g. 'C,R,U,D' or '' (none)"
          },
          "grantedBy": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "BucketAccessGroupDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BucketAccessGroup"
          },
          {
            "type": "object",
            "required": [
              "members",
              "grants"
            ],
            "properties": {
              "members": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BucketAccessGroupMember"
                }
              },
              "grants": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BucketGrant"
                }
              }
            }
          }
        ]
      },
      "BucketAccessGroupList": {
        "type": "object",
        "required": [
          "accessGroups"
        ],
        "properties": {
          "accessGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BucketAccessGroup"
            }
          }
        }
      },
      "AccessTag": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "name",
          "description",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string",
            "description": "owning ecosystem"
          },
          "name": {
            "type": "string",
            "description": "unique within the ecosystem"
          },
          "description": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "AccessTagList": {
        "type": "object",
        "required": [
          "tags"
        ],
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessTag"
            }
          }
        }
      },
      "BucketTypeTagIds": {
        "type": "object",
        "required": [
          "tagIds"
        ],
        "properties": {
          "tagIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ChatConversation": {
        "type": "object",
        "required": [
          "id",
          "title",
          "model",
          "personaSlug",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "personaSlug": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "required": [
          "id",
          "role",
          "content",
          "toolName",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "description": "e.g. user, assistant, tool, system"
          },
          "content": {
            "type": "string"
          },
          "toolName": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "ChatConversationDetail": {
        "type": "object",
        "required": [
          "conversation",
          "messages"
        ],
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/ChatConversation"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            }
          }
        }
      },
      "ChatConversationCreate": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "model": {
            "type": "string"
          },
          "personaSlug": {
            "type": "string"
          }
        }
      },
      "ChatConversationRename": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      },
      "ChatMessageEdit": {
        "type": "object",
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string"
          }
        }
      },
      "ChatSendMessage": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1
          },
          "clientMessageId": {
            "type": "string",
            "description": "Idempotency key for the user message"
          }
        }
      },
      "ChatStreamEvent": {
        "description": "One event in the SSE chat stream. The SSE `event:` name carries the discriminator (`open` | `token` | `tool_call_started` | `tool_call_completed` | `done` | `error`); the JSON `data:` payload is one of the shapes below.",
        "oneOf": [
          {
            "title": "ChatTokenEvent",
            "type": "object",
            "description": "token — a chunk of streamed assistant text",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string"
              }
            }
          },
          {
            "title": "ChatToolCallStartedEvent",
            "type": "object",
            "description": "tool_call_started — the model invoked a tool",
            "required": [
              "name",
              "arguments"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "arguments": {
                "type": "string",
                "description": "JSON-encoded tool arguments"
              }
            }
          },
          {
            "title": "ChatToolCallCompletedEvent",
            "type": "object",
            "description": "tool_call_completed — a tool finished",
            "required": [
              "name",
              "ok",
              "result"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "ok": {
                "type": "boolean"
              },
              "result": {
                "type": "string",
                "description": "JSON-encoded tool result"
              }
            }
          },
          {
            "title": "ChatDoneEvent",
            "type": "object",
            "description": "done — the turn completed (empty payload)"
          },
          {
            "title": "ChatErrorEvent",
            "type": "object",
            "description": "error — the turn failed; the message explains why (HTTP stays 200)",
            "required": [
              "message"
            ],
            "properties": {
              "message": {
                "type": "string"
              }
            }
          }
        ]
      },
      "ChatLiveEvent": {
        "type": "object",
        "description": "The `data` of an event on GET /chat/stream. Which fields are present depends on the SSE event name (see the route); every chat event carries `chatId`.",
        "properties": {
          "chatId": {
            "type": "string"
          },
          "seq": {
            "type": "integer",
            "description": "`message`, `message_updated`"
          },
          "participantId": {
            "type": "string",
            "description": "`typing`"
          },
          "state": {
            "type": "string",
            "enum": [
              "start",
              "stop"
            ],
            "description": "`typing`"
          },
          "expiresAt": {
            "type": "string",
            "description": "`typing` — ISO time the indicator lapses"
          },
          "added": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`participants_changed` (participant ids), `chats_changed` (chat ids)"
          },
          "removed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`participants_changed` (participant ids), `chats_changed` (chat ids)"
          },
          "chatIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`ready`"
          }
        }
      },
      "DmMessage": {
        "type": "object",
        "description": "One direct message. Also the payload of a `message` event on the DM SSE stream.",
        "required": [
          "id",
          "chatId",
          "senderParticipantId",
          "senderUserId",
          "seq",
          "role",
          "body",
          "state",
          "dateSent"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "chatId": {
            "type": "string",
            "maxLength": 36
          },
          "senderParticipantId": {
            "type": "string",
            "nullable": true
          },
          "senderUserId": {
            "type": "string"
          },
          "seq": {
            "type": "integer",
            "description": "Per-chat monotonic sequence; the stream cursor"
          },
          "role": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "dateSent": {
            "type": "string"
          }
        }
      },
      "DmMessagePreview": {
        "type": "object",
        "nullable": true,
        "description": "The chat's most recent message, trimmed to what a chat list renders.",
        "required": [
          "id",
          "senderParticipantId",
          "body",
          "seq",
          "dateSent"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "senderParticipantId": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string"
          },
          "seq": {
            "type": "integer"
          },
          "dateSent": {
            "type": "string"
          }
        }
      },
      "DmChatSummary": {
        "type": "object",
        "required": [
          "chatId",
          "otherUserId",
          "lastMessage",
          "unreadCount"
        ],
        "properties": {
          "chatId": {
            "type": "string",
            "maxLength": 36
          },
          "otherUserId": {
            "type": "string"
          },
          "lastMessage": {
            "$ref": "#/components/schemas/DmMessagePreview"
          },
          "unreadCount": {
            "type": "integer"
          }
        }
      },
      "DmChatList": {
        "type": "object",
        "required": [
          "chats",
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "chats": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmChatSummary"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          }
        }
      },
      "DmMessageList": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmMessage"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          }
        }
      },
      "DmCreateRequest": {
        "type": "object",
        "required": [
          "recipientId"
        ],
        "properties": {
          "recipientId": {
            "type": "string",
            "minLength": 1,
            "description": "The other user. The caller's own id is a 400."
          }
        }
      },
      "DmCreateResult": {
        "type": "object",
        "required": [
          "id",
          "otherUserId",
          "created"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "description": "The chat id"
          },
          "otherUserId": {
            "type": "string"
          },
          "created": {
            "type": "boolean",
            "description": "false when an existing chat was reused"
          }
        }
      },
      "DmSendMessage": {
        "type": "object",
        "required": [
          "body"
        ],
        "properties": {
          "body": {
            "type": "string",
            "minLength": 1
          },
          "clientMessageId": {
            "type": "string",
            "description": "Idempotency key; a replay returns 200"
          }
        }
      },
      "DmReadRequest": {
        "type": "object",
        "properties": {
          "messageId": {
            "type": "string",
            "description": "Mark read through this message; omit for the latest"
          }
        }
      },
      "DmReadResult": {
        "type": "object",
        "required": [
          "success",
          "unreadCount"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          },
          "unreadCount": {
            "type": "integer"
          }
        }
      },
      "ChatParticipant": {
        "type": "object",
        "required": [
          "id",
          "participantId",
          "type",
          "role",
          "joinedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The participant ROW id — what a message’s `senderParticipantId` names"
          },
          "participantId": {
            "type": "string",
            "description": "A user id or a persona id, per `type`"
          },
          "type": {
            "type": "string",
            "enum": [
              "user",
              "persona"
            ]
          },
          "role": {
            "type": "string",
            "description": "owner, member or assistant"
          },
          "joinedAt": {
            "type": "string"
          }
        }
      },
      "Chat": {
        "type": "object",
        "required": [
          "id",
          "type",
          "definitionId",
          "name",
          "photoStorageKey",
          "createdByUserId",
          "createdAt",
          "updatedAt",
          "participants"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "dm",
              "group"
            ]
          },
          "definitionId": {
            "type": "string",
            "description": "The definition the chat follows; a DM reports the built-in `direct`’s id"
          },
          "name": {
            "type": "string"
          },
          "photoStorageKey": {
            "type": "string",
            "nullable": true
          },
          "createdByUserId": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "participants": {
            "type": "array",
            "description": "Joined participants, longest-standing first",
            "items": {
              "$ref": "#/components/schemas/ChatParticipant"
            }
          }
        }
      },
      "ChatInboxEntry": {
        "description": "One row of the caller’s chat list: a chat, its last message and unread count.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Chat"
          },
          {
            "type": "object",
            "required": [
              "lastMessage",
              "unreadCount"
            ],
            "properties": {
              "lastMessage": {
                "$ref": "#/components/schemas/DmMessagePreview"
              },
              "unreadCount": {
                "type": "integer"
              }
            }
          }
        ]
      },
      "ChatList": {
        "type": "object",
        "required": [
          "chats",
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "chats": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatInboxEntry"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          }
        }
      },
      "ChatDefinitionList": {
        "type": "object",
        "required": [
          "definitions"
        ],
        "properties": {
          "definitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatDefinition"
            }
          }
        }
      },
      "ChatEnvelope": {
        "type": "object",
        "required": [
          "chat"
        ],
        "properties": {
          "chat": {
            "$ref": "#/components/schemas/Chat"
          }
        }
      },
      "ChatDetail": {
        "type": "object",
        "required": [
          "chat",
          "definition"
        ],
        "properties": {
          "chat": {
            "$ref": "#/components/schemas/Chat"
          },
          "definition": {
            "$ref": "#/components/schemas/ChatDefinition"
          }
        }
      },
      "ChatCreateRequest": {
        "type": "object",
        "required": [
          "definition"
        ],
        "properties": {
          "definition": {
            "type": "string",
            "minLength": 1,
            "description": "The definition’s id or slug"
          },
          "userIds": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "personaIds": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "name": {
            "type": "string",
            "description": "Defaults to the definition’s name"
          }
        }
      },
      "ChatCreateResult": {
        "type": "object",
        "required": [
          "chat",
          "skippedPersonaIds"
        ],
        "properties": {
          "chat": {
            "$ref": "#/components/schemas/Chat"
          },
          "skippedPersonaIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The definition’s own personas that were not seated because they no longer exist"
          }
        }
      },
      "ChatUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "photoStorageKey": {
            "type": "string",
            "nullable": true,
            "description": "null clears the photo"
          }
        }
      },
      "ChatParticipantsAddRequest": {
        "type": "object",
        "properties": {
          "userIds": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "personaIds": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      },
      "ChatParticipantsAddResult": {
        "type": "object",
        "required": [
          "chat",
          "added",
          "skippedPersonaIds"
        ],
        "properties": {
          "chat": {
            "$ref": "#/components/schemas/Chat"
          },
          "added": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatParticipant"
            }
          },
          "skippedPersonaIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The definition’s own personas that were asked for but not seated because they no longer exist"
          }
        }
      },
      "ChatParticipantRemoveResult": {
        "type": "object",
        "required": [
          "chat",
          "removed",
          "newOwner"
        ],
        "properties": {
          "chat": {
            "$ref": "#/components/schemas/Chat"
          },
          "removed": {
            "$ref": "#/components/schemas/ChatParticipant"
          },
          "newOwner": {
            "description": "The user who became owner when the owner left; otherwise null",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChatParticipant"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ChatMessageList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmMessage"
            }
          }
        }
      },
      "ChatTypingRequest": {
        "type": "object",
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "start",
              "stop"
            ]
          }
        }
      },
      "ChatPersonaReplyEvent": {
        "type": "object",
        "description": "The `data` of an event on the persona-reply stream of POST /chat/chats/{id}/messages. The SSE event name discriminates (see the route): `open` carries `message`; `persona_start` carries `participantId` and `personaId`; `message` carries `participantId` and `message`; every turn event (`token`, `tool_call_started`, `tool_call_completed`, `status`, `award`, `done`, `ended`, `error`) carries its own fields (see ChatStreamEvent) plus `participantId`.",
        "properties": {
          "participantId": {
            "type": "string",
            "description": "The replying persona’s participant row id"
          },
          "personaId": {
            "type": "string",
            "description": "`persona_start`"
          },
          "message": {
            "$ref": "#/components/schemas/DmMessage"
          }
        }
      },
      "CommunicationSettings": {
        "type": "object",
        "required": [
          "dmAudienceMask",
          "presenceAudienceMask",
          "appearOffline"
        ],
        "properties": {
          "dmAudienceMask": {
            "type": "integer",
            "minimum": 0,
            "description": "AUDIENCE bitmask of who may DM the user (0 = nobody; default PUBLIC|HUB = 3)"
          },
          "presenceAudienceMask": {
            "type": "integer",
            "minimum": 0,
            "description": "AUDIENCE bitmask of who may see the user presence (0 = nobody; default PUBLIC|HUB = 3)"
          },
          "appearOffline": {
            "type": "boolean",
            "description": "When true, presence is hidden from EVERYONE regardless of the mask"
          }
        }
      },
      "AppearanceSettings": {
        "type": "object",
        "required": [
          "prefs"
        ],
        "properties": {
          "prefs": {
            "type": "object",
            "properties": {
              "colorMode": {
                "type": "string",
                "enum": [
                  "auto",
                  "light",
                  "dark"
                ],
                "description": "The user's colour scheme; 'auto' follows the operating system"
              },
              "reduceMotion": {
                "type": "string",
                "enum": [
                  "auto",
                  "on",
                  "off"
                ]
              },
              "contrast": {
                "type": "string",
                "enum": [
                  "default",
                  "high",
                  "extra-high"
                ]
              },
              "textSize": {
                "type": "string",
                "enum": [
                  "default",
                  "small",
                  "large",
                  "extra-large"
                ]
              },
              "spacing": {
                "type": "string",
                "enum": [
                  "compact",
                  "comfortable",
                  "spacious"
                ]
              },
              "focusOutlines": {
                "type": "boolean"
              },
              "underlineLinks": {
                "type": "boolean"
              }
            },
            "description": "Empty object when the user has never saved a preference (client defaults apply)"
          }
        }
      },
      "WorkspacePrefs": {
        "type": "object",
        "required": [
          "prefs"
        ],
        "properties": {
          "prefs": {
            "type": "object",
            "properties": {
              "slug": {
                "type": "string",
                "description": "The workspace the user's /home chooser last landed on (a workspace slug)"
              }
            },
            "description": "Empty object when the user has never chosen a workspace (the client falls back to their personal one)"
          }
        }
      },
      "GamificationLevel": {
        "type": "object",
        "required": [
          "name",
          "minPoints",
          "sortOrder"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "minPoints": {
            "type": "integer",
            "description": "Inclusive point floor for this rung"
          },
          "sortOrder": {
            "type": "integer"
          },
          "subjectType": {
            "type": "string",
            "nullable": true,
            "description": "NULL = applies to any subject kind"
          }
        }
      },
      "GamificationBadge": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "icon",
          "criteriaType",
          "criteriaThreshold",
          "pointValue"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "criteriaType": {
            "type": "string"
          },
          "criteriaThreshold": {
            "type": "integer"
          },
          "pointValue": {
            "type": "integer"
          },
          "subjectType": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "GamificationRealmBadge": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "icon",
          "pointValue"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "statKey": {
            "type": "string",
            "nullable": true,
            "description": "The stat the rule watches"
          },
          "comparator": {
            "type": "string",
            "nullable": true,
            "enum": [
              ">=",
              ">",
              "=",
              null
            ]
          },
          "threshold": {
            "type": "integer",
            "nullable": true
          },
          "badgeLine": {
            "type": "string",
            "nullable": true,
            "description": "Groups the tiers of one line"
          },
          "tier": {
            "type": "string",
            "nullable": true,
            "enum": [
              "none",
              "bronze",
              "silver",
              "gold",
              "platinum",
              null
            ]
          },
          "pointValue": {
            "type": "integer",
            "description": "XP granted when earned"
          },
          "hidden": {
            "type": "boolean"
          },
          "active": {
            "type": "boolean"
          },
          "subjectType": {
            "type": "string",
            "nullable": true
          },
          "ecosystemId": {
            "type": "string",
            "nullable": true,
            "description": "NULL = platform default; else the realm"
          }
        }
      },
      "GamificationCatalogBadge": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GamificationRealmBadge"
          },
          {
            "type": "object",
            "required": [
              "source"
            ],
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "default",
                  "realm"
                ],
                "description": "'realm' when a realm row shadows the same-slot default"
              }
            }
          }
        ]
      },
      "GamificationCatalogLevel": {
        "type": "object",
        "required": [
          "name",
          "minPoints",
          "source"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "minPoints": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "enum": [
              "default",
              "realm"
            ]
          }
        }
      },
      "GamificationCatalog": {
        "type": "object",
        "required": [
          "badges",
          "levels"
        ],
        "properties": {
          "badges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationCatalogBadge"
            }
          },
          "levels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationCatalogLevel"
            }
          }
        }
      },
      "GamificationRealmBadgeInput": {
        "type": "object",
        "required": [
          "name",
          "description",
          "icon",
          "statKey",
          "threshold",
          "badgeLine",
          "tier",
          "pointValue"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "statKey": {
            "type": "string"
          },
          "comparator": {
            "type": "string",
            "enum": [
              ">=",
              ">",
              "="
            ],
            "default": ">="
          },
          "threshold": {
            "type": "integer",
            "minimum": 0
          },
          "badgeLine": {
            "type": "string"
          },
          "tier": {
            "type": "string",
            "enum": [
              "none",
              "bronze",
              "silver",
              "gold",
              "platinum"
            ]
          },
          "pointValue": {
            "type": "integer",
            "minimum": 0
          },
          "hidden": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "GamificationRealmLevelsUpdate": {
        "type": "object",
        "required": [
          "levels",
          "replayHint"
        ],
        "properties": {
          "levels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationCatalogLevel"
            }
          },
          "replayHint": {
            "type": "string",
            "description": "The owner may POST /replay to backfill retroactively"
          }
        }
      },
      "GamificationRealmEventType": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "name",
          "statKey"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "The custom event_type key"
          },
          "statKey": {
            "type": "string",
            "description": "The gamification stat this event bumps"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "GamificationRealmEventTypeInput": {
        "type": "object",
        "required": [
          "name",
          "statKey"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Custom event type key (≤64 chars); unique per realm"
          },
          "statKey": {
            "type": "string",
            "description": "The stat this event bumps (≤64 chars)"
          }
        }
      },
      "GamificationCustomEventResult": {
        "type": "object",
        "required": [
          "ingested",
          "statKey",
          "newBadges",
          "xpGained"
        ],
        "properties": {
          "ingested": {
            "type": "boolean",
            "description": "false ⇒ the dedupeKey was already seen (no-op)"
          },
          "statKey": {
            "type": "string"
          },
          "newBadges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationBadge"
            }
          },
          "xpGained": {
            "type": "integer"
          }
        }
      },
      "GamificationLeaderboardEntry": {
        "type": "object",
        "required": [
          "subjectType",
          "subjectId",
          "avatarUrl",
          "totalPoints"
        ],
        "properties": {
          "subjectType": {
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Display name (users only)"
          },
          "avatarUrl": {
            "type": "string"
          },
          "totalPoints": {
            "type": "integer"
          },
          "level": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "GamificationLeaderboard": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationLeaderboardEntry"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          }
        }
      },
      "GamificationSubjectBadge": {
        "type": "object",
        "required": [
          "id",
          "badgeId",
          "name",
          "description",
          "icon",
          "awardedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "badgeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "awardedAt": {
            "type": "string"
          }
        }
      },
      "GamificationSummary": {
        "type": "object",
        "required": [
          "subjectType",
          "subjectId",
          "totalPoints",
          "optedOut",
          "badges"
        ],
        "properties": {
          "subjectType": {
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          },
          "totalPoints": {
            "type": "integer"
          },
          "level": {
            "type": "string",
            "nullable": true
          },
          "optedOut": {
            "type": "boolean"
          },
          "badges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationSubjectBadge"
            }
          }
        }
      },
      "GamificationPoints": {
        "type": "object",
        "required": [
          "id",
          "amount",
          "reason",
          "sourceType",
          "sourceId",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "sourceType": {
            "type": "string"
          },
          "sourceId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "GamificationPointsPage": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationPoints"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          }
        }
      },
      "GamificationAwardResult": {
        "type": "object",
        "required": [
          "awarded",
          "total",
          "newBadges"
        ],
        "properties": {
          "awarded": {
            "type": "boolean",
            "description": "false when the subject has opted out"
          },
          "total": {
            "type": "integer",
            "description": "The subject’s new point total"
          },
          "newBadges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationBadge"
            }
          }
        }
      },
      "GamificationPreference": {
        "type": "object",
        "required": [
          "subjectType",
          "subjectId",
          "optedOut"
        ],
        "properties": {
          "subjectType": {
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          },
          "optedOut": {
            "type": "boolean"
          }
        }
      },
      "GamificationReplayResult": {
        "type": "object",
        "required": [
          "subjects",
          "badges"
        ],
        "properties": {
          "subjects": {
            "type": "integer",
            "description": "Subjects touched (1 for a single-subject replay)"
          },
          "badges": {
            "type": "integer",
            "description": "Newly-granted badges across the replayed subject(s)"
          },
          "xpGained": {
            "type": "integer",
            "description": "Points granted — single-subject replay only"
          }
        }
      },
      "GamificationBoardEntry": {
        "type": "object",
        "required": [
          "rank",
          "value",
          "persona"
        ],
        "properties": {
          "rank": {
            "type": "integer",
            "description": "1-based rank among the surviving (public) entries"
          },
          "value": {
            "type": "integer",
            "description": "The window's ranking value: rolling30 → 30-day sum, allTime → all-time total, trending → raw recent-7d sum (the hotness score only orders; it is not returned)."
          },
          "persona": {
            "type": "object",
            "required": [
              "slug",
              "name"
            ],
            "properties": {
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          }
        }
      },
      "GamificationBoard": {
        "type": "object",
        "required": [
          "statKey",
          "window",
          "entries"
        ],
        "properties": {
          "statKey": {
            "type": "string",
            "enum": [
              "adventures",
              "allies",
              "days_active"
            ]
          },
          "window": {
            "type": "string",
            "enum": [
              "rolling30",
              "allTime",
              "trending",
              "season"
            ]
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationBoardEntry"
            }
          }
        }
      },
      "GamificationSeasons": {
        "type": "object",
        "nullable": true,
        "required": [
          "anchor",
          "lengthDays"
        ],
        "properties": {
          "anchor": {
            "type": "string",
            "description": "Season 0 start day (YYYY-MM-DD, UTC)"
          },
          "lengthDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 366,
            "description": "Days per season"
          }
        }
      },
      "GamificationRealmConfig": {
        "type": "object",
        "required": [
          "ecosystemId",
          "mode",
          "skin",
          "surfaces",
          "seasons",
          "timezone"
        ],
        "properties": {
          "ecosystemId": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "none",
              "gamification",
              "game"
            ],
            "description": "'none' leaves telemetry flowing but suppresses awards/UI; 'gamification' turns on badges/levels/streaks/leaderboards; 'game' is a dedicated playable game, which brings gamification with it"
          },
          "skin": {
            "type": "string",
            "enum": [
              "rpg",
              "plain"
            ]
          },
          "surfaces": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "Per-surface toggles; a surface is ON unless set false"
          },
          "seasons": {
            "$ref": "#/components/schemas/GamificationSeasons",
            "description": "Season board window config; null ⇒ seasons off"
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone for the realm's day/streak boundary (Night Owl); defaults to 'UTC'"
          }
        }
      },
      "GamificationRealmConfigUpdate": {
        "type": "object",
        "required": [
          "config"
        ],
        "properties": {
          "config": {
            "$ref": "#/components/schemas/GamificationRealmConfig"
          },
          "replayed": {
            "$ref": "#/components/schemas/GamificationReplayResult",
            "description": "Present only when enabling the realm triggered a retroactive replay"
          }
        }
      },
      "GameRef": {
        "type": "object",
        "required": [
          "id",
          "slug"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        }
      },
      "GameSessionStart": {
        "type": "object",
        "required": [
          "kind"
        ],
        "description": "Exactly one of `game_id` / `slug` names the game. `chat_id` makes the call a resume.",
        "properties": {
          "game_id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "maxLength": 64
          },
          "chat_id": {
            "type": "string",
            "maxLength": 36
          },
          "subject_artifact_id": {
            "type": "string",
            "maxLength": 36
          }
        }
      },
      "GameSession": {
        "type": "object",
        "required": [
          "id",
          "gameId",
          "kind",
          "status",
          "actorType",
          "startedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "ended",
              "abandoned"
            ]
          },
          "actorType": {
            "type": "string",
            "enum": [
              "user",
              "visitor"
            ]
          },
          "chatId": {
            "type": "string",
            "nullable": true
          },
          "subjectArtifactId": {
            "type": "string",
            "nullable": true
          },
          "payload": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "startedAt": {
            "type": "string"
          },
          "endedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "GameSessionDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameSession"
          },
          {
            "type": "object",
            "required": [
              "summary"
            ],
            "properties": {
              "summary": {
                "type": "object",
                "additionalProperties": true,
                "nullable": true
              }
            }
          }
        ]
      },
      "GameEventPost": {
        "type": "object",
        "required": [
          "kind",
          "client_event_id"
        ],
        "description": "`client_event_id` is the caller’s idempotency key: reposting the same one returns the stored event and executes nothing.",
        "properties": {
          "kind": {
            "type": "string",
            "maxLength": 64
          },
          "client_event_id": {
            "type": "string",
            "maxLength": 64
          },
          "input": {
            "type": "object",
            "additionalProperties": true
          },
          "output": {
            "type": "object",
            "additionalProperties": true
          },
          "cost": {
            "type": "object",
            "additionalProperties": true
          },
          "artifact_id": {
            "type": "string",
            "maxLength": 36
          }
        }
      },
      "GameEvent": {
        "type": "object",
        "required": [
          "id",
          "sessionId",
          "kind",
          "seq",
          "clientEventId",
          "occurredAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "seq": {
            "type": "integer"
          },
          "clientEventId": {
            "type": "string"
          },
          "input": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "output": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "cost": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "artifactId": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          }
        }
      },
      "GameArtifact": {
        "type": "object",
        "required": [
          "id",
          "gameId",
          "kind",
          "role",
          "origin",
          "visibility",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "nullable": true
          },
          "origin": {
            "type": "string"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "unlisted",
              "private"
            ]
          },
          "slot": {
            "type": "string",
            "nullable": true
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "text": {
            "type": "string",
            "nullable": true
          },
          "contentFormat": {
            "type": "string",
            "nullable": true
          },
          "engineVersion": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "summary": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "exposureCount": {
            "type": "integer"
          },
          "score": {
            "type": "integer"
          },
          "publishedAt": {
            "type": "string",
            "nullable": true
          },
          "lastActiveAt": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "GameFeedItem": {
        "type": "object",
        "required": [
          "id",
          "gameId",
          "kind",
          "role"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "nullable": true
          },
          "slot": {
            "type": "string",
            "nullable": true
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "text": {
            "type": "string",
            "nullable": true
          },
          "contentFormat": {
            "type": "string",
            "nullable": true
          },
          "summary": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "score": {
            "type": "integer"
          },
          "exposureCount": {
            "type": "integer"
          },
          "publishedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "GameHoldingPut": {
        "type": "object",
        "required": [
          "artifact_id",
          "kind"
        ],
        "properties": {
          "game_id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "artifact_id": {
            "type": "string",
            "maxLength": 36
          },
          "kind": {
            "type": "string",
            "maxLength": 64
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "GameHolding": {
        "type": "object",
        "required": [
          "id",
          "gameId",
          "artifactId",
          "kind",
          "quantity",
          "acquiredAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "artifactId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "acquiredAt": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "GameHoldingWithArtifact": {
        "type": "object",
        "required": [
          "id",
          "gameId",
          "artifactId",
          "kind",
          "quantity",
          "acquiredAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "artifactId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "acquiredAt": {
            "type": "string"
          },
          "artifactKind": {
            "type": "string"
          },
          "artifactSlot": {
            "type": "string",
            "nullable": true
          },
          "artifactSummary": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "artifactVisibility": {
            "type": "string"
          }
        }
      },
      "GamePlayerPatch": {
        "type": "object",
        "description": "Omit a key to leave it alone; send `null` to clear it. `character_name` is screened whenever it is set, whatever the profile’s visibility.",
        "properties": {
          "game_id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "character_name": {
            "type": "string",
            "maxLength": 120,
            "nullable": true
          },
          "character_avatar_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 1024,
            "nullable": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "unlisted",
              "private"
            ]
          }
        }
      },
      "GamePlayer": {
        "type": "object",
        "required": [
          "id",
          "gameId",
          "visibility",
          "firstPlayedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "characterName": {
            "type": "string",
            "nullable": true
          },
          "characterAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "unlisted",
              "private"
            ]
          },
          "firstPlayedAt": {
            "type": "string"
          },
          "lastPlayedAt": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "GamePublicProfile": {
        "type": "object",
        "required": [
          "game",
          "slug",
          "visibility",
          "stats"
        ],
        "properties": {
          "game": {
            "$ref": "#/components/schemas/GameRef"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "characterName": {
            "type": "string",
            "nullable": true
          },
          "characterAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "unlisted"
            ]
          },
          "firstPlayedAt": {
            "type": "string"
          },
          "lastPlayedAt": {
            "type": "string",
            "nullable": true
          },
          "stats": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamePlayerStat"
            }
          }
        }
      },
      "GamePlayerStat": {
        "type": "object",
        "required": [
          "key",
          "value"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "integer"
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "periodType": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          }
        }
      },
      "GameInstance": {
        "type": "object",
        "required": [
          "id",
          "definitionId",
          "locationType",
          "locationId",
          "quantity",
          "depth"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "definitionId": {
            "type": "string"
          },
          "locationType": {
            "type": "string",
            "enum": [
              "player",
              "session",
              "instance",
              "game"
            ]
          },
          "locationId": {
            "type": "string"
          },
          "slot": {
            "type": "string",
            "nullable": true
          },
          "quantity": {
            "type": "integer"
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "depth": {
            "type": "integer"
          }
        }
      },
      "GameState": {
        "type": "object",
        "required": [
          "game",
          "state",
          "gameState",
          "hasProfile"
        ],
        "properties": {
          "game": {
            "$ref": "#/components/schemas/GameRef"
          },
          "state": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "gameState": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "hasProfile": {
            "type": "boolean"
          }
        }
      },
      "GameTermPost": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "game_id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "artifact_id": {
            "type": "string",
            "maxLength": 36
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "GameDefinition": {
        "type": "object",
        "required": [
          "id",
          "gameId",
          "kind",
          "key",
          "name",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "retired"
            ]
          },
          "authorCustomerId": {
            "type": "string",
            "nullable": true
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "CustomerAuthResult": {
        "type": "object",
        "required": [
          "token",
          "refreshToken",
          "customerId"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "End-customer access token (typ='customer' JWT, short-lived)"
          },
          "refreshToken": {
            "type": "string",
            "description": "Opaque customer-session refresh token (single-use; rotated on refresh)"
          },
          "customerId": {
            "type": "string",
            "description": "The end-customer id"
          }
        }
      },
      "CustomerResolveResult": {
        "type": "object",
        "required": [
          "customerId"
        ],
        "properties": {
          "customerId": {
            "type": "string",
            "description": "The stable ADH customer id for this externalId"
          }
        }
      },
      "CustomerRegisterResult": {
        "type": "object",
        "required": [
          "customerId"
        ],
        "properties": {
          "customerId": {
            "type": "string",
            "description": "The newly provisioned end-customer id"
          }
        }
      },
      "DiscussionTopic": {
        "type": "object",
        "required": [
          "id",
          "communityId",
          "title",
          "isPinned",
          "isLocked",
          "isPublic",
          "replyCount",
          "lastActivityAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "communityId": {
            "type": "string",
            "description": "The community instance this topic belongs to."
          },
          "customerId": {
            "type": "string",
            "description": "Author (server-stamped principal). Omitted on the public surface."
          },
          "title": {
            "type": "string"
          },
          "categoryId": {
            "type": "string",
            "nullable": true
          },
          "isPinned": {
            "type": "boolean"
          },
          "isLocked": {
            "type": "boolean"
          },
          "isPublic": {
            "type": "boolean"
          },
          "replyCount": {
            "type": "integer"
          },
          "answeredPostId": {
            "type": "string",
            "nullable": true
          },
          "lastActivityAt": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "excerpt": {
            "type": "string",
            "nullable": true,
            "description": "LIST routes only: the opening post’s leading prose, flattened from markdown server-side (≤240 chars; null when its body doc was soft-deleted). Absent on single-topic reads and create/update responses."
          },
          "authorName": {
            "type": "string",
            "nullable": true,
            "description": "Authed COMMUNITY list route only: the author’s display name. Never on the public surface or the flat /discussion/topics list."
          },
          "authorSlug": {
            "type": "string",
            "nullable": true,
            "description": "Authed COMMUNITY list route only: the author’s public handle. Never on the public surface or the flat /discussion/topics list."
          },
          "authorAvatarUrl": {
            "type": "string",
            "nullable": true,
            "description": "Authed COMMUNITY list route only: the author’s avatar URL. Never on the public surface or the flat /discussion/topics list."
          }
        }
      },
      "DiscussionPost": {
        "type": "object",
        "required": [
          "id",
          "topicId",
          "parentPostId",
          "postNumber",
          "bodyDocumentId",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "topicId": {
            "type": "string"
          },
          "parentPostId": {
            "type": "string",
            "nullable": true
          },
          "postNumber": {
            "type": "integer"
          },
          "bodyDocumentId": {
            "type": "string",
            "nullable": true,
            "description": "The content.markdown doc backing this post’s body."
          },
          "customerId": {
            "type": "string",
            "description": "Author (server-stamped principal). Omitted on the public surface."
          },
          "ecosystemId": {
            "type": "string",
            "description": "Owning ecosystem (present on create only)."
          },
          "communityId": {
            "type": "string",
            "description": "The community instance (inherited from the topic; present on create only)."
          },
          "content": {
            "type": "string",
            "nullable": true,
            "description": "Resolved markdown body (present on the list routes; null if the body doc was deleted)."
          },
          "isDeleted": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "EcosystemFeatureFlag": {
        "type": "object",
        "required": [
          "key",
          "enabled",
          "description",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "CatalogFeature": {
        "type": "object",
        "required": [
          "key",
          "label",
          "description",
          "subscriptionTier"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Stable, permanent identifier."
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "subscriptionTier": {
            "type": "string",
            "enum": [
              "Free",
              "Pro",
              "Team",
              "Enterprise"
            ],
            "description": "Displayed as \"Subscription Level Required: <tier>\". A PLACEHOLDER — nothing enforces it."
          },
          "featureSite": {
            "type": "boolean",
            "description": "The feature carries a public site of its own (the persona registry, research)."
          },
          "comingSoon": {
            "type": "boolean",
            "description": "Not built yet. Listed so the picker can say it is coming; provisioning it is refused (400)."
          },
          "requiresFeatures": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Feature keys this one needs. Adding it provisions them too; they cannot be removed while it is active (409 feature_required)."
          },
          "allowedIn": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "workspace",
                "persona",
                "personal",
                "organization",
                "container",
                "product"
              ]
            },
            "description": "The ecosystem types that may hold it; absent means every type except workspace, personal and organization. Adding it elsewhere is refused (400). GET /ecosystem/features/{id}/availability names these per ecosystem."
          },
          "workspaceOwnerKinds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "customer",
                "organization"
              ]
            },
            "description": "Narrows allowedIn for a workspace by who owns it: Teams is allowed only in an organization workspace. Absent means either owner kind."
          },
          "automaticIn": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "workspace",
                "persona",
                "personal",
                "organization",
                "container",
                "product"
              ]
            },
            "description": "The ecosystem types that get it when provisioned, with no owner opt-in (a workspace gets Personas; a Personal or Organization ecosystem gets its hub data)."
          },
          "includedWith": {
            "type": "string",
            "description": "The feature this one comes with (the Users Settings, the Applications Client Auth panel). The picker does not list it: adding the parent adds it, removing the parent removes it, adding it adds the parent, and removing it on its own is refused (400)."
          }
        }
      },
      "UnavailableFeature": {
        "type": "object",
        "required": [
          "key",
          "reason"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "description": "Why this ecosystem may not add it — shown by the picker."
          }
        }
      },
      "ProvisionedFeature": {
        "type": "object",
        "required": [
          "featureKey",
          "state",
          "provisionedAt",
          "updatedAt"
        ],
        "properties": {
          "featureKey": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "provisioning",
              "active",
              "removed"
            ],
            "description": "Only `active` counts as on. `provisioning` is a claim whose artifacts are not all there yet; `removed` keeps the record (and the data) of a feature taken off the rail."
          },
          "provisionedAt": {
            "type": "string",
            "description": "When the feature was FIRST added. Never rewritten by a re-add."
          },
          "provisionedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "ChatDefinition": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "slug",
          "name",
          "description",
          "state",
          "maxParticipants",
          "allowInvites",
          "invitePolicy",
          "userConfigurable",
          "personaReplyPolicy",
          "allowAddedPersonas",
          "encryptionMode",
          "personaIds",
          "builtIn",
          "createdAt",
          "updatedAt",
          "deletedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The built-in `direct` definition is always 00000000-0000-4000-8000-000000000001."
          },
          "ecosystemId": {
            "type": "string",
            "nullable": true,
            "description": "Null for built-in `direct`."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ],
            "description": "`archived` offers the definition for no new chats; existing chats keep working."
          },
          "maxParticipants": {
            "type": "integer",
            "minimum": 2,
            "description": "The developer’s ceiling. Must not exceed the system maximum (CHAT_MAX_PARTICIPANTS, default 32) when written; at use, the lower of the two applies."
          },
          "allowInvites": {
            "type": "boolean"
          },
          "invitePolicy": {
            "type": "string",
            "enum": [
              "any_participant",
              "owner"
            ]
          },
          "userConfigurable": {
            "type": "boolean",
            "description": "Whether participants may change the chat’s own settings."
          },
          "personaReplyPolicy": {
            "type": "string",
            "enum": [
              "every_message",
              "when_mentioned"
            ]
          },
          "allowAddedPersonas": {
            "type": "boolean",
            "description": "Whether participants may add personas beyond the definition’s own."
          },
          "personaIds": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The personas every chat of this definition seats. Each must be usable by the caller, and they must leave at least one seat under maxParticipants."
          },
          "slug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Lowercase letters, digits and interior hyphens. `direct` is reserved, and a uuid-shaped slug is refused (a uuid in the path is always read as an id)."
          },
          "encryptionMode": {
            "type": "string",
            "enum": [
              "none"
            ],
            "description": "Read-only. Only `none` until end-to-end encryption lands."
          },
          "builtIn": {
            "type": "boolean",
            "description": "True for `direct` (one-to-one DMs): read-only, present in every ecosystem."
          },
          "createdAt": {
            "type": "string",
            "nullable": true
          },
          "updatedAt": {
            "type": "string",
            "nullable": true
          },
          "deletedAt": {
            "type": "string",
            "nullable": true,
            "description": "Always null here: a deleted definition is never listed or returned."
          }
        }
      },
      "ChatDefinitionCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "maxParticipants"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ],
            "description": "`archived` offers the definition for no new chats; existing chats keep working."
          },
          "maxParticipants": {
            "type": "integer",
            "minimum": 2,
            "description": "The developer’s ceiling. Must not exceed the system maximum (CHAT_MAX_PARTICIPANTS, default 32) when written; at use, the lower of the two applies."
          },
          "allowInvites": {
            "type": "boolean"
          },
          "invitePolicy": {
            "type": "string",
            "enum": [
              "any_participant",
              "owner"
            ]
          },
          "userConfigurable": {
            "type": "boolean",
            "description": "Whether participants may change the chat’s own settings."
          },
          "personaReplyPolicy": {
            "type": "string",
            "enum": [
              "every_message",
              "when_mentioned"
            ]
          },
          "allowAddedPersonas": {
            "type": "boolean",
            "description": "Whether participants may add personas beyond the definition’s own."
          },
          "personaIds": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The personas every chat of this definition seats. Each must be usable by the caller, and they must leave at least one seat under maxParticipants."
          },
          "slug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Lowercase letters, digits and interior hyphens. `direct` is reserved, and a uuid-shaped slug is refused (a uuid in the path is always read as an id). Defaults to the name, slugified and cut to 64 characters; `chat` when the name has no ASCII letter or digit."
          }
        }
      },
      "ChatDefinitionUpdate": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "Partial. `personaIds`, when present, REPLACES the set.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ],
            "description": "`archived` offers the definition for no new chats; existing chats keep working."
          },
          "maxParticipants": {
            "type": "integer",
            "minimum": 2,
            "description": "The developer’s ceiling. Must not exceed the system maximum (CHAT_MAX_PARTICIPANTS, default 32) when written; at use, the lower of the two applies."
          },
          "allowInvites": {
            "type": "boolean"
          },
          "invitePolicy": {
            "type": "string",
            "enum": [
              "any_participant",
              "owner"
            ]
          },
          "userConfigurable": {
            "type": "boolean",
            "description": "Whether participants may change the chat’s own settings."
          },
          "personaReplyPolicy": {
            "type": "string",
            "enum": [
              "every_message",
              "when_mentioned"
            ]
          },
          "allowAddedPersonas": {
            "type": "boolean",
            "description": "Whether participants may add personas beyond the definition’s own."
          },
          "personaIds": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The personas every chat of this definition seats. Each must be usable by the caller, and they must leave at least one seat under maxParticipants."
          },
          "slug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Lowercase letters, digits and interior hyphens. `direct` is reserved, and a uuid-shaped slug is refused (a uuid in the path is always read as an id)."
          }
        }
      },
      "EcosystemServerBagEntry": {
        "type": "object",
        "required": [
          "key",
          "value",
          "description",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "description": "Arbitrary JSON value"
          },
          "description": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "Community": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "isPublic"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true,
            "description": "Opaque per-instance config bag."
          },
          "isPublic": {
            "type": "boolean"
          }
        }
      },
      "PublicCommunity": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "isPublic"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "isPublic": {
            "type": "boolean"
          }
        }
      },
      "CommunityCategory": {
        "type": "object",
        "required": [
          "id",
          "communityId",
          "slug",
          "name",
          "displayOrder",
          "isPublic",
          "isArchived",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "communityId": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "displayOrder": {
            "type": "integer"
          },
          "isPublic": {
            "type": "boolean"
          },
          "isArchived": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "discussionCount": {
            "type": "integer",
            "description": "Live discussions filed under this category (public-only for anonymous callers)."
          },
          "lastActivityAt": {
            "type": "string",
            "nullable": true,
            "description": "Most recent activity across the category’s live discussions (null when empty)."
          }
        }
      },
      "CommunityMember": {
        "type": "object",
        "required": [
          "communityId",
          "customerId",
          "role",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "communityId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "owner | admin | moderator | member"
          },
          "bio": {
            "type": "string",
            "nullable": true,
            "description": "The member’s one-line \"what I’m building\" intro for this community."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "CommunityDirectoryEntry": {
        "type": "object",
        "required": [
          "customerId",
          "role",
          "joinedAt",
          "postCount",
          "activeCategoryIds"
        ],
        "properties": {
          "customerId": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "owner | admin | moderator | member"
          },
          "bio": {
            "type": "string",
            "nullable": true
          },
          "joinedAt": {
            "type": "string"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "slug": {
            "type": "string",
            "nullable": true
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          },
          "postCount": {
            "type": "integer",
            "description": "Live posts by this member in this community."
          },
          "activeCategoryIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Distinct category ids this member has posted in."
          }
        }
      },
      "CommunityProfile": {
        "type": "object",
        "required": [
          "customerId",
          "slug",
          "avatarUrl"
        ],
        "properties": {
          "customerId": {
            "type": "string"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "slug": {
            "type": "string"
          },
          "avatarUrl": {
            "type": "string"
          }
        }
      },
      "StringList": {
        "type": "object",
        "title": "StringList",
        "description": "A wrapper object `{ items: string[] }` (NOT a bare array). Returned by the public tag/category facet endpoints and the project label list.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The string values."
          }
        }
      },
      "MarkdownCategoryNode": {
        "type": "object",
        "title": "MarkdownCategoryNode",
        "required": [
          "id",
          "name",
          "parentIds",
          "sortOrder"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "parentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every category this one sits under (content.category_edges). Empty for an unfiled category — there is no null sentinel. A category may appear under several parents at once, so a consumer folding this into a tree renders the same node in more than one place. Parent ids that are not themselves in `nodes` are already filtered out, and the write path rejects cycles, so the fold terminates."
          },
          "sortOrder": {
            "type": "integer",
            "description": "Order among the unfiled/root categories (0 unless set through the generic CRUD). Order among one parent's children lives on the edge."
          }
        }
      },
      "MarkdownCategoryTree": {
        "type": "object",
        "title": "MarkdownCategoryTree",
        "required": [
          "items",
          "nodes"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Distinct category names, alphabetical."
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarkdownCategoryNode"
            },
            "description": "The category rows, by sortOrder then name."
          }
        }
      },
      "MarkdownKeywordNode": {
        "type": "object",
        "title": "MarkdownKeywordNode",
        "required": [
          "id",
          "label"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The row id — what ADDRESSES this tag for a rename or delete (`/content/keywords/{id}`). A label cannot: links point at the id, so renaming the row renames the tag everywhere it is used."
          },
          "label": {
            "type": "string",
            "description": "The tag text. Unique per owner + ecosystem."
          }
        }
      },
      "MarkdownTagSet": {
        "type": "object",
        "title": "MarkdownTagSet",
        "required": [
          "items",
          "nodes"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tag labels, alphabetical."
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarkdownKeywordNode"
            },
            "description": "The same labels with their row ids, in the same order."
          }
        }
      },
      "MarkdownDocument": {
        "type": "object",
        "required": [
          "id",
          "customerId",
          "ecosystemId",
          "ownerKind",
          "ownerId",
          "title",
          "content",
          "contentHash",
          "sizeBytes",
          "currentVersion",
          "tags",
          "visibility",
          "stage",
          "kind",
          "createdAt",
          "updatedAt",
          "isDeleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "The CREATOR/author (public routes key on this)."
          },
          "ecosystemId": {
            "type": "string",
            "description": "Ecosystem (tenant) id."
          },
          "ownerKind": {
            "type": "string",
            "enum": [
              "customer",
              "organization"
            ],
            "description": "The kind of principal that OWNS the doc (what access scopes by)."
          },
          "ownerId": {
            "type": "string",
            "description": "The owning principal (customer or organization id); server-stamped from the verified ?workspace= scope, else the creator."
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "Server-derived, read-only: the frontmatter `title` then `name`, else the first non-empty line of the body (frontmatter and code fences ignored, leading markdown syntax stripped), else 'Untitled'. Capped at 500 characters."
          },
          "content": {
            "type": "string",
            "description": "Full raw markdown, byte-exact."
          },
          "frontmatter": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true,
            "description": "Optional classification label."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tag set (defaults to [])."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "public"
            ],
            "description": "Publication state: 'public' is readable on the public surface, 'private' is a draft."
          },
          "stage": {
            "type": "string",
            "enum": [
              "draft",
              "final"
            ],
            "description": "Editorial stage: 'draft' is editable; 'final' is immutable (content edits + version writes are rejected)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "paper",
              "research"
            ],
            "description": "Document kind: 'paper' (ordinary) or 'research' (AI-ingested, carries an adh_source frontmatter key)."
          },
          "publicRoute": {
            "type": "string",
            "nullable": true,
            "description": "Public route slug (non-null iff visibility='public'); unique per author."
          },
          "contentHash": {
            "type": "string",
            "description": "SHA-256 hex of content (ETag)."
          },
          "sizeBytes": {
            "type": "integer"
          },
          "currentVersion": {
            "type": "integer",
            "description": "The current revision number (incremented on every edit)."
          },
          "latestVersionId": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "isDeleted": {
            "type": "boolean"
          }
        }
      },
      "MarkdownDocumentSummary": {
        "type": "object",
        "required": [
          "id",
          "title",
          "excerpt",
          "contentHash",
          "sizeBytes",
          "currentVersion",
          "tags",
          "visibility",
          "stage",
          "kind",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "Server-derived, read-only: the frontmatter `title` then `name`, else the first non-empty line of the body (frontmatter and code fences ignored, leading markdown syntax stripped), else 'Untitled'. Capped at 500 characters."
          },
          "excerpt": {
            "type": "string",
            "description": "Server-derived, read-only preview: up to 4 body lines FOLLOWING the title line, newline-separated, each capped at 160 characters and stripped of leading markdown syntax. Empty when the body holds nothing past its title. Exists because this projection carries no `content` — it is what lets a list render a preview without fetching every document whole."
          },
          "frontmatter": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "public"
            ]
          },
          "stage": {
            "type": "string",
            "enum": [
              "draft",
              "final"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "paper",
              "research"
            ]
          },
          "publicRoute": {
            "type": "string",
            "nullable": true
          },
          "contentHash": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer"
          },
          "currentVersion": {
            "type": "integer"
          },
          "latestVersionId": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "MarkdownDocumentVersion": {
        "type": "object",
        "required": [
          "id",
          "documentId",
          "customerId",
          "ecosystemId",
          "ownerKind",
          "ownerId",
          "version",
          "title",
          "content",
          "contentHash",
          "sizeBytes",
          "createdAt",
          "isDeleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "documentId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "The revision WRITER."
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "ecosystemId": {
            "type": "string"
          },
          "ownerKind": {
            "type": "string",
            "enum": [
              "customer",
              "organization"
            ],
            "description": "Inherited from the head document at write."
          },
          "ownerId": {
            "type": "string",
            "description": "Inherited from the head document at write."
          },
          "version": {
            "type": "integer"
          },
          "title": {
            "type": "string",
            "description": "Document title at this revision (full-state snapshot)."
          },
          "content": {
            "type": "string"
          },
          "contentHash": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer"
          },
          "frontmatter": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "authorType": {
            "type": "string",
            "nullable": true
          },
          "authorId": {
            "type": "string",
            "nullable": true
          },
          "authorName": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "isDeleted": {
            "type": "boolean"
          }
        }
      },
      "MarkdownDocumentVersionSummary": {
        "type": "object",
        "required": [
          "id",
          "version",
          "title",
          "contentHash",
          "sizeBytes",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "contentHash": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer"
          },
          "authorType": {
            "type": "string",
            "nullable": true
          },
          "authorId": {
            "type": "string",
            "nullable": true
          },
          "authorName": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "MessagingLogEntry": {
        "type": "object",
        "required": [
          "id",
          "customerId",
          "ecosystemId",
          "channel",
          "recipient",
          "body",
          "status",
          "origin",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "Target user (recipient) id"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "ecosystemId": {
            "type": "string",
            "description": "Ecosystem (tenant) id"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "recipient": {
            "type": "string",
            "description": "Resolved destination (email address or phone)"
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string"
          },
          "templateId": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "failed"
            ],
            "description": "Send outcome"
          },
          "providerId": {
            "type": "string",
            "nullable": true,
            "description": "Provider message id (when sent)"
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "sentBy": {
            "type": "string",
            "nullable": true,
            "description": "Admin user id who issued the send"
          },
          "origin": {
            "type": "string",
            "enum": [
              "platform",
              "ecosystem"
            ],
            "description": "Sending surface: 'ecosystem' = the per-ecosystem Messaging tool; 'platform' = automated/system send (only the admin log shows these)"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "MessagingLogPage": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessagingLogEntry"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          }
        }
      },
      "MessagingTemplate": {
        "type": "object",
        "required": [
          "id",
          "name",
          "subject",
          "htmlBody",
          "textBody",
          "category"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "htmlBody": {
            "type": "string"
          },
          "textBody": {
            "type": "string"
          },
          "smsBody": {
            "type": "string"
          },
          "category": {
            "type": "string"
          }
        }
      },
      "MessagingStatus": {
        "type": "object",
        "required": [
          "email",
          "sms"
        ],
        "properties": {
          "email": {
            "type": "boolean",
            "description": "Postmark configured + enabled"
          },
          "sms": {
            "type": "boolean",
            "description": "Twilio configured + enabled"
          }
        }
      },
      "MessagingSendResult": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "failed"
            ]
          },
          "providerId": {
            "type": "string",
            "description": "Provider message id (on success)"
          },
          "error": {
            "type": "string",
            "description": "Failure reason (on failure)"
          }
        }
      },
      "Notification": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "userId",
          "category",
          "title",
          "data",
          "status",
          "isRead",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "category": {
            "type": "string"
          },
          "entityKind": {
            "type": "string",
            "nullable": true
          },
          "entityId": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string",
            "nullable": true
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          },
          "status": {
            "type": "string",
            "enum": [
              "inbox",
              "archived",
              "trashed"
            ]
          },
          "isRead": {
            "type": "boolean"
          },
          "dedupeKey": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "readAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "NotificationPreference": {
        "type": "object",
        "required": [
          "category",
          "email",
          "sms",
          "inApp"
        ],
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "account",
              "community_reply",
              "community_mention",
              "admin_announcement",
              "direct_message",
              "project_assigned",
              "project_mention",
              "project_comment",
              "project_status",
              "project_due"
            ]
          },
          "email": {
            "type": "boolean"
          },
          "sms": {
            "type": "boolean"
          },
          "inApp": {
            "type": "boolean",
            "description": "In-app (inbox) delivery for this category."
          }
        }
      },
      "NotificationWakeEvent": {
        "type": "object",
        "description": "The payload of every event on GET /notifications/stream — always `{}`. The SSE `event:` name (`notification` or `ready`) carries the whole meaning; the body deliberately carries none, so a client can never read the stream instead of the inbox."
      },
      "Friendship": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "requesterId",
          "addresseeId",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "requesterId": {
            "type": "string"
          },
          "addresseeId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "declined"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "FriendEntry": {
        "type": "object",
        "required": [
          "friendId",
          "friendship"
        ],
        "properties": {
          "friendId": {
            "type": "string"
          },
          "friendship": {
            "$ref": "#/components/schemas/Friendship"
          }
        }
      },
      "Follow": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "followerId",
          "followeeId",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "followerId": {
            "type": "string"
          },
          "followeeId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "UserBlock": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "blockerId",
          "blockedId",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "blockerId": {
            "type": "string"
          },
          "blockedId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "Bookmark": {
        "type": "object",
        "required": [
          "id",
          "customerId",
          "ecosystemId",
          "targetKind",
          "targetId",
          "notify",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "targetKind": {
            "type": "string"
          },
          "targetId": {
            "type": "string"
          },
          "notify": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Note": {
        "type": "object",
        "required": [
          "id",
          "content",
          "title",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "Derived from the doc’s first line."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "Reaction": {
        "type": "object",
        "required": [
          "id",
          "customerId",
          "ecosystemId",
          "targetKind",
          "targetId",
          "emoji",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "targetKind": {
            "type": "string"
          },
          "targetId": {
            "type": "string"
          },
          "emoji": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PollVote": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "customerId",
          "optionId",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "optionId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PollTallyOption": {
        "type": "object",
        "required": [
          "optionId",
          "text",
          "sortOrder",
          "votes"
        ],
        "properties": {
          "optionId": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer"
          },
          "votes": {
            "type": "integer"
          }
        }
      },
      "PollTally": {
        "type": "object",
        "required": [
          "pollId",
          "options",
          "myOptionIds"
        ],
        "properties": {
          "pollId": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PollTallyOption"
            }
          },
          "myOptionIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ContactMethod": {
        "type": "object",
        "required": [
          "id",
          "type",
          "value",
          "verified",
          "isPrimary"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "email",
              "phone"
            ]
          },
          "value": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          },
          "isPrimary": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "PresenceView": {
        "type": "object",
        "required": [
          "userId",
          "online",
          "lastSeenAt"
        ],
        "properties": {
          "userId": {
            "type": "string"
          },
          "online": {
            "type": "boolean"
          },
          "lastSeenAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PresenceList": {
        "type": "object",
        "required": [
          "presence"
        ],
        "properties": {
          "presence": {
            "type": "array",
            "description": "One entry per requested id, in the order requested (duplicates included).",
            "items": {
              "$ref": "#/components/schemas/PresenceView"
            }
          }
        }
      },
      "PresenceHeartbeatResult": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          }
        }
      },
      "PrivacyGrant": {
        "type": "object",
        "required": [
          "targetTable",
          "targetId",
          "audienceMask"
        ],
        "properties": {
          "targetTable": {
            "type": "string",
            "enum": [
              "avatar",
              "social_links",
              "addresses",
              "contact_methods"
            ]
          },
          "targetId": {
            "type": "string"
          },
          "audienceMask": {
            "type": "integer"
          }
        }
      },
      "Project": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "status",
          "color",
          "estimateScale",
          "priorityScale",
          "itemNoun",
          "itemNounPlural",
          "keyPrefix",
          "createdAt",
          "updatedAt",
          "isDeleted",
          "syncVersion",
          "customerId",
          "ecosystemId",
          "ownerKind",
          "ownerId",
          "health",
          "healthUpdatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "lifecycle status (DB default 'active')"
          },
          "color": {
            "type": "string",
            "description": "hex board accent (DB default #007AFF)"
          },
          "estimateScale": {
            "type": "string",
            "enum": [
              "none",
              "points",
              "fibonacci",
              "exponential",
              "linear",
              "tshirt"
            ],
            "description": "how this board writes estimates (DB default 'none' — the board does not estimate). Advisory: it tells a client which picker to render, and constrains nothing the API accepts."
          },
          "priorityScale": {
            "type": "string",
            "enum": [
              "standard",
              "none"
            ],
            "description": "whether this board ranks its work (DB default 'standard'). Advisory in the same way: 'none' means render no priority control and no priority column, and the API still accepts and returns the 0–4 integer every card already carries."
          },
          "itemNoun": {
            "type": "string",
            "description": "what this board calls ONE of its items, lower-case (DB default 'work item') — the word a client puts in 'New …', in an empty state and in a bulk-action count"
          },
          "itemNounPlural": {
            "type": "string",
            "description": "what this board calls MANY of its items (DB default 'work items'). Stored rather than derived from itemNoun: English pluralisation is not a rule this API can pretend to know ('story' → 'storys'), so the word is the author's."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "isDeleted": {
            "type": "boolean"
          },
          "syncVersion": {
            "type": "integer"
          },
          "customerId": {
            "type": "string",
            "description": "the customer (user) who created the project"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "ecosystemId": {
            "type": "string",
            "description": "the owning ecosystem (tenant scope)"
          },
          "archivedAt": {
            "type": "string",
            "nullable": true,
            "description": "ISO timestamp when archived; null = not archived"
          },
          "ownerKind": {
            "type": "string",
            "enum": [
              "customer",
              "organization"
            ],
            "description": "the kind of principal that OWNS the project"
          },
          "ownerId": {
            "type": "string",
            "description": "the owning principal (customer or organization id); server-stamped from the verified ?workspace= scope, else the creator"
          },
          "keyPrefix": {
            "type": "string",
            "description": "the prefix every card's key is rendered from (ADH-42) — 2–8 chars, a letter then letters or digits, stored upper-cased and unique among the OWNER's live boards. '' = unassigned (a project predating migration 0181, until the backfill reaches it); its cards render an empty key rather than a broken one."
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "description": "date (YYYY-MM-DD); null = no committed start"
          },
          "targetDate": {
            "type": "string",
            "nullable": true,
            "description": "date (YYYY-MM-DD); never before startDate; null = no committed target"
          },
          "leadKind": {
            "type": "string",
            "enum": [
              "customer",
              "persona",
              "team",
              null
            ],
            "nullable": true,
            "description": "the kind of principal that ANSWERS for the project. Whole or absent: a lead is always a kind AND an id, never half of one."
          },
          "leadId": {
            "type": "string",
            "nullable": true,
            "description": "set with leadKind (both or neither)"
          },
          "programId": {
            "type": "string",
            "nullable": true,
            "description": "the program this board rolls up into; null = it stands alone. The program belongs to the project's OWNER, so a workspace can group boards without a project ever naming a container another workspace runs."
          },
          "health": {
            "type": "string",
            "enum": [
              "on_track",
              "at_risk",
              "off_track",
              null
            ],
            "nullable": true,
            "description": "DERIVED, never stored: the health on the NEWEST live status update (GET /project/projects/{id}/status-updates returns it first). null means no update has been posted — which is not \"on track\", and the distinction is the reason this is not a column with a default. Retracting the newest update moves it back to the previous one, or to null."
          },
          "healthUpdatedAt": {
            "type": "string",
            "nullable": true,
            "description": "when the update that decided `health` was posted; null exactly when `health` is null. A dashboard needs this to say whether a green board is green or merely stale."
          }
        }
      },
      "ProjectStatus": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "key",
          "label",
          "category",
          "position",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "key": {
            "type": "string",
            "description": "stable identifier, unique within the project"
          },
          "label": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "backlog",
              "todo",
              "in_progress",
              "done",
              "canceled"
            ]
          },
          "position": {
            "type": "integer",
            "description": "column order (ascending)"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "ProjectSavedView": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "name",
          "config",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "unique among this project’s live views"
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "opaque client-defined view config (view id, filter, sort). Stored whole, never interpreted; must be a JSON object and serialize to at most 8192 bytes."
          },
          "createdBy": {
            "type": "string",
            "nullable": true,
            "description": "who saved it; confers nothing"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "ProjectParticipant": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "participantKind",
          "participantId",
          "role",
          "addedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "participantKind": {
            "type": "string",
            "enum": [
              "customer",
              "persona",
              "team"
            ]
          },
          "participantId": {
            "type": "string",
            "description": "the attached actor id (opaque)"
          },
          "role": {
            "type": "string",
            "description": "the participant's project role (DB default 'member')"
          },
          "addedBy": {
            "type": "string",
            "nullable": true
          },
          "addedAt": {
            "type": "string"
          }
        }
      },
      "ProjectField": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "key",
          "label",
          "type",
          "position",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "key": {
            "type": "string",
            "description": "stable identifier, unique within the project"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "number",
              "date",
              "select",
              "user",
              "checkbox"
            ]
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "the choices for a select field (non-empty); null for every other type"
          },
          "position": {
            "type": "integer",
            "description": "field order (ascending)"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "ProjectIteration": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "ownerKind",
          "ownerId",
          "name",
          "description",
          "startDate",
          "endDate",
          "state",
          "createdAt",
          "updatedAt",
          "isDeleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "the customer (user) who created the iteration"
          },
          "ownerKind": {
            "type": "string",
            "enum": [
              "customer",
              "organization"
            ],
            "description": "the kind of principal that OWNS the time-box"
          },
          "ownerId": {
            "type": "string",
            "description": "the owning principal; server-stamped from the verified ?workspace= scope, else the creator"
          },
          "name": {
            "type": "string",
            "description": "unique among the workspace’s live iterations"
          },
          "description": {
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "description": "date (YYYY-MM-DD), inclusive"
          },
          "endDate": {
            "type": "string",
            "description": "date (YYYY-MM-DD), inclusive; never before startDate"
          },
          "state": {
            "type": "string",
            "enum": [
              "upcoming",
              "active",
              "completed"
            ],
            "description": "derived from startDate/endDate against today (UTC), inclusive at both ends: upcoming before the box opens, active within it, completed after"
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "isDeleted": {
            "type": "boolean"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "ProjectProgram": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "ownerKind",
          "ownerId",
          "name",
          "description",
          "color",
          "createdAt",
          "updatedAt",
          "isDeleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "the customer (user) who created the program"
          },
          "ownerKind": {
            "type": "string",
            "enum": [
              "customer",
              "organization"
            ],
            "description": "the kind of principal that OWNS the program"
          },
          "ownerId": {
            "type": "string",
            "description": "the owning principal; server-stamped from the verified ?workspace= scope, else the creator"
          },
          "name": {
            "type": "string",
            "description": "unique among the workspace’s live programs"
          },
          "description": {
            "type": "string"
          },
          "color": {
            "type": "string",
            "description": "hex accent (DB default #007AFF)"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "description": "date (YYYY-MM-DD); null is ordinary here, UNLIKE an iteration — a standing program (\"Platform\") has no start, and a delivery program usually knows its target long before one"
          },
          "targetDate": {
            "type": "string",
            "nullable": true,
            "description": "date (YYYY-MM-DD); never before startDate"
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "isDeleted": {
            "type": "boolean"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "ProjectMilestone": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "name",
          "description",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "inherited from the owning project by trigger, never sent"
          },
          "projectId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "unique among the project’s live milestones"
          },
          "description": {
            "type": "string"
          },
          "targetDate": {
            "type": "string",
            "nullable": true,
            "description": "date (YYYY-MM-DD); null = undated, an ordinary state — an ordered-but-undated plan is a real thing, and requiring a date would only get one invented. Undated milestones sort LAST."
          },
          "counts": {
            "type": "object",
            "required": [
              "backlog",
              "todo",
              "in_progress",
              "done",
              "canceled"
            ],
            "description": "the milestone’s live cards counted by status CATEGORY, every category present (0 included) so a client never has to distinguish an absent key from an empty column. DERIVED on every read, never stored. The API deliberately reports no percentage: whether a `canceled` card belongs in the denominator is a product question, and answering it here would freeze one answer into the wire format.",
            "properties": {
              "backlog": {
                "type": "integer"
              },
              "todo": {
                "type": "integer"
              },
              "in_progress": {
                "type": "integer"
              },
              "done": {
                "type": "integer"
              },
              "canceled": {
                "type": "integer"
              }
            }
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "ProjectStatusUpdate": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "health",
          "body",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "inherited from the owning project by trigger, never sent"
          },
          "projectId": {
            "type": "string"
          },
          "health": {
            "type": "string",
            "enum": [
              "on_track",
              "at_risk",
              "off_track"
            ],
            "description": "the reported health. The NEWEST live update’s value is what `Project.health` returns."
          },
          "body": {
            "type": "string",
            "description": "the report itself (1–10000 chars)"
          },
          "createdBy": {
            "type": "string",
            "nullable": true,
            "description": "the AUTHOR, as the acting principal — a persona’s report is the persona’s. Never re-written: an edit revises the words, it does not change who signed them."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "ProjectTemplate": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "ownerKind",
          "ownerId",
          "kind",
          "name",
          "description",
          "body",
          "createdAt",
          "updatedAt",
          "isDeleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "the customer (user) who created the template"
          },
          "ownerKind": {
            "type": "string",
            "enum": [
              "customer",
              "organization"
            ],
            "description": "the kind of principal that OWNS the template"
          },
          "ownerId": {
            "type": "string",
            "description": "the owning principal; server-stamped from the verified ?workspace= scope, else the creator"
          },
          "kind": {
            "type": "string",
            "enum": [
              "work_item",
              "project"
            ],
            "description": "what this template MAKES, and therefore which schema its `body` is read against. Immutable — a PATCH cannot re-kind a template, because that would silently re-interpret a stored body against a schema it was never written for."
          },
          "name": {
            "type": "string",
            "description": "unique among the workspace’s live templates OF THIS KIND"
          },
          "description": {
            "type": "string"
          },
          "body": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WorkItemTemplateBody"
              },
              {
                "$ref": "#/components/schemas/ProjectTemplateBody"
              }
            ],
            "description": "the stored shape, read against `kind`"
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "isDeleted": {
            "type": "boolean"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "WorkItemTemplateBody": {
        "type": "object",
        "required": [
          "title"
        ],
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "description": {
            "type": "string",
            "maxLength": 10000
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4,
            "description": "rank, 0 (none) to 4 (urgent); higher is more urgent"
          },
          "estimate": {
            "type": "integer",
            "minimum": 0
          },
          "labels": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string"
            }
          },
          "children": {
            "type": "array",
            "maxItems": 50,
            "description": "the sub-tasks that always come with this card — ONE level deep, because a body that could nest arbitrarily would be a project template wearing the wrong noun. Each child inherits the parent’s column, plan point and cycle at instantiation.",
            "items": {
              "type": "object",
              "required": [
                "title"
              ],
              "additionalProperties": false,
              "properties": {
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                },
                "description": {
                  "type": "string",
                  "maxLength": 10000
                },
                "priority": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 4,
                  "description": "rank, 0 (none) to 4 (urgent); higher is more urgent"
                },
                "estimate": {
                  "type": "integer",
                  "minimum": 0
                },
                "labels": {
                  "type": "array",
                  "maxItems": 50,
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "ProjectTemplateBody": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 10000
          },
          "color": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "estimateScale": {
            "type": "string",
            "enum": [
              "none",
              "points",
              "fibonacci",
              "exponential",
              "linear",
              "tshirt"
            ]
          },
          "priorityScale": {
            "type": "string",
            "enum": [
              "standard",
              "none"
            ]
          },
          "itemNoun": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "itemNounPlural": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "statuses": {
            "type": "array",
            "minItems": 1,
            "maxItems": 30,
            "description": "the board columns to open with, IN ORDER — the array IS the order, so no positions appear here to disagree with the list they sit in. Keys must be unique. Omitted opens the board with the usual three columns.",
            "items": {
              "type": "object",
              "required": [
                "key",
                "label",
                "category"
              ],
              "additionalProperties": false,
              "properties": {
                "key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "category": {
                  "type": "string",
                  "enum": [
                    "backlog",
                    "todo",
                    "in_progress",
                    "done",
                    "canceled"
                  ]
                }
              }
            }
          },
          "milestones": {
            "type": "array",
            "maxItems": 50,
            "description": "the plan points to seed, undated. Names must be unique.",
            "items": {
              "type": "object",
              "required": [
                "name"
              ],
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                },
                "description": {
                  "type": "string",
                  "maxLength": 10000
                }
              }
            }
          }
        }
      },
      "TriageHit": {
        "type": "object",
        "required": [
          "id",
          "projectId",
          "projectName",
          "itemKey",
          "title",
          "description",
          "statusId",
          "priority",
          "priorityScale",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "projectName": {
            "type": "string",
            "description": "the OWNING board’s name — a queue spanning boards is undecidable without it, and the client cannot join it itself."
          },
          "itemKey": {
            "type": "string",
            "description": "the rendered key (`ADH-42`)"
          },
          "itemNumber": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "statusId": {
            "type": "string",
            "description": "the column the card was FILED into. It is not a decision anyone has made yet — that is precisely what triage withholds — but an intake form that files by category has already said something worth showing."
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4,
            "description": "rank, 0 (none) to 4 (urgent); higher is more urgent"
          },
          "priorityScale": {
            "type": "string",
            "enum": [
              "standard",
              "none"
            ],
            "description": "whether the OWNING board ranks its work — 'none' means show no priority for this row. Carried per row for the same reason projectName is: the queue spans boards, so the client has no single project to read it off. The board's item NOUN is deliberately absent: a queue mixing recipes and stories has no single word for what it holds."
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "when it arrived; the queue is ordered by this, oldest first"
          }
        }
      },
      "WorkItemSearchHit": {
        "type": "object",
        "required": [
          "id",
          "projectId",
          "projectName",
          "itemKey",
          "title",
          "statusId",
          "updatedAt",
          "snippet",
          "rank"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "projectName": {
            "type": "string",
            "description": "the OWNING board’s name. A result list spanning boards is unreadable without it, and the client cannot join it itself — the boards a search reaches are exactly the ones it may not have loaded."
          },
          "itemKey": {
            "type": "string",
            "description": "the rendered key (`ADH-42`) — already joined from the board’s prefix, because a hit crossing boards crosses prefixes too."
          },
          "title": {
            "type": "string"
          },
          "statusId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "snippet": {
            "type": "string",
            "description": "a plain-text excerpt of the DESCRIPTION (ts_headline, no markup). Empty-ish for a title-only or key hit, where the title is already the answer."
          },
          "rank": {
            "type": "number",
            "description": "ts_rank over title (weight A) and description (weight B)."
          }
        }
      },
      "WorkItem": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "title",
          "description",
          "statusId",
          "priority",
          "labels",
          "rank",
          "createdAt",
          "updatedAt",
          "isDeleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "statusId": {
            "type": "string",
            "description": "the board column this card sits in"
          },
          "assigneeKind": {
            "type": "string",
            "enum": [
              "customer",
              "persona",
              "team",
              null
            ],
            "nullable": true
          },
          "assigneeId": {
            "type": "string",
            "nullable": true
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4,
            "description": "rank, 0 (none) to 4 (urgent); higher is more urgent"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "description": "date (YYYY-MM-DD)"
          },
          "dueDate": {
            "type": "string",
            "nullable": true,
            "description": "date (YYYY-MM-DD)"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "the card's labels, from the owner's shared tag vocabulary (the same one research documents draw on), in authored order"
          },
          "parentId": {
            "type": "string",
            "nullable": true,
            "description": "a parent work item in the same project"
          },
          "iterationId": {
            "type": "string",
            "nullable": true,
            "description": "the time-box this card is committed to; null is the BACKLOG — a real state, not an absence. The iteration belongs to the project OWNER, not the project, so a workspace can run one cycle across several boards."
          },
          "milestoneId": {
            "type": "string",
            "nullable": true,
            "description": "the milestone this card counts toward; null = it counts toward none. UNLIKE `iterationId` — which names a time-box the project's OWNER holds — this must be a milestone of the card's OWN project (400 otherwise): a milestone is a point in one plan, and a card counts toward the plan of the board it sits on."
          },
          "estimate": {
            "type": "integer",
            "nullable": true,
            "description": "the card's size, in whatever unit the project's `estimateScale` names. A non-negative integer; null is UNESTIMATED, which is distinct from 0 (estimated as trivial)."
          },
          "rank": {
            "type": "string",
            "description": "board order within the project — an opaque key that sorts ascending by BYTE, so a client compares two cards with `<` and never parses one. Set only by the server (a create appends; POST /project/work-items/{id}/move reorders), so there is no way — and no need — to send one."
          },
          "triagedAt": {
            "type": "string",
            "nullable": true,
            "description": "when this card was ACCEPTED onto the board. null = it is sitting in the triage inbox and the board’s list omits it (GET /project/projects/{id}/work-items?includeUntriaged=true shows it anyway). Every card created without `triage: true` is accepted at creation, so a board that never used an intake queue has none of these. Server-set: POST /project/work-items/{id}/triage stamps it once and nothing un-stamps it."
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "isDeleted": {
            "type": "boolean"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "IterationWorkItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WorkItem"
          },
          {
            "type": "object",
            "required": [
              "itemKey",
              "projectName",
              "statusName",
              "statusCategory",
              "estimateScale",
              "priorityScale"
            ],
            "properties": {
              "itemKey": {
                "type": "string",
                "description": "the card's rendered key (ADH-42); '' when its project has no prefix"
              },
              "projectName": {
                "type": "string",
                "description": "the board this card belongs to"
              },
              "statusName": {
                "type": "string",
                "description": "the column this card sits in, by NAME — `statusId` alone cannot be resolved here, because the ids come from as many status sets as there are boards in the box"
              },
              "statusCategory": {
                "type": "string",
                "enum": [
                  "backlog",
                  "todo",
                  "in_progress",
                  "done",
                  "canceled"
                ],
                "description": "that column’s category — what \"left in this cycle\" means, and the same field the rollover reads"
              },
              "estimateScale": {
                "type": "string",
                "enum": [
                  "none",
                  "points",
                  "fibonacci",
                  "exponential",
                  "linear",
                  "tshirt"
                ],
                "description": "the SCALE the board this card came from estimates in. Carried per row for the same reason as the two above: `estimate` is a number in its own project’s units, so a box whose boards disagree has no summable total, and only this field makes that detectable."
              },
              "priorityScale": {
                "type": "string",
                "enum": [
                  "standard",
                  "none"
                ],
                "description": "whether the board this card came from ranks its work — 'none' means render no priority for THIS row. Per row, because a cycle draws from boards that need not agree."
              }
            }
          }
        ]
      },
      "WorkItemFieldValue": {
        "type": "object",
        "required": [
          "fieldId",
          "key",
          "label",
          "type"
        ],
        "properties": {
          "fieldId": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "number",
              "date",
              "select",
              "user",
              "checkbox"
            ]
          },
          "value": {
            "nullable": true,
            "description": "the field's stored value for this item (type matches the field's type); null when unset"
          }
        }
      },
      "WorkItemDependency": {
        "type": "object",
        "required": [
          "id",
          "dependsOnId",
          "title",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "the dependency edge id"
          },
          "dependsOnId": {
            "type": "string",
            "description": "the work item this one depends on"
          },
          "title": {
            "type": "string",
            "description": "the depended-on item title (joined)"
          },
          "status": {
            "type": "string",
            "description": "the depended-on item statusId (joined)"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "WorkItemRelation": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "direction",
          "relatedId",
          "relatedKey",
          "title",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "the relation edge id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "depends_on",
              "duplicates",
              "relates_to"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "outgoing",
              "incoming"
            ],
            "description": "outgoing = this item is the subject of the edge (it depends on / duplicates the other); incoming = the other item is"
          },
          "relatedId": {
            "type": "string",
            "description": "the work item at the far end"
          },
          "relatedKey": {
            "type": "string",
            "description": "the far item's rendered key (ADH-42); '' when the project has no prefix"
          },
          "title": {
            "type": "string",
            "description": "the far item title (joined)"
          },
          "status": {
            "type": "string",
            "description": "the far item statusId (joined)"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "ProjectActivity": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "action",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "workItemId": {
            "type": "string",
            "nullable": true,
            "description": "set when the event is card-scoped"
          },
          "actorKind": {
            "type": "string",
            "nullable": true
          },
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "actorLabel": {
            "type": "string",
            "nullable": true
          },
          "action": {
            "type": "string",
            "description": "the event, e.g. project.created/updated/deleted, status.*, participant.*, work_item.created/updated/status_changed/assigned/iteration_changed/deleted, comment.added/edited/deleted. Iteration CRUD itself appends nothing — this table is FK-bound to a project and an iteration has none — but committing a card to a box writes work_item.iteration_changed on that card's project, which is where the history is legible."
          },
          "detail": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true,
            "description": "action-specific payload (jsonb)"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "ProjectComment": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "workItemId",
          "body",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "workItemId": {
            "type": "string"
          },
          "parentId": {
            "type": "string",
            "nullable": true,
            "description": "the comment this one replies to; null for a top-level comment"
          },
          "authorKind": {
            "type": "string",
            "nullable": true,
            "enum": [
              "customer",
              "persona",
              "team"
            ]
          },
          "authorId": {
            "type": "string",
            "nullable": true
          },
          "authorLabel": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string"
          },
          "editedAt": {
            "type": "string",
            "nullable": true,
            "description": "set the first time the body changes; the prior text is in the trail"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "TargetDescriptor": {
        "type": "object",
        "required": [
          "kind",
          "id",
          "title",
          "subtitle",
          "url"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "the target's registry, e.g. 'content.markdown'"
          },
          "id": {
            "type": "string",
            "description": "the opaque target id"
          },
          "title": {
            "type": "string",
            "description": "the row's display title; never empty"
          },
          "subtitle": {
            "type": "string",
            "nullable": true,
            "description": "one supporting line, or null"
          },
          "url": {
            "type": "string",
            "nullable": true,
            "description": "set only when the target is a link OUT of the platform (a saved URL)"
          }
        }
      },
      "ProjectArtifact": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "projectId",
          "direction",
          "targetKind",
          "targetId",
          "createdAt",
          "updatedAt",
          "target"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "ingested",
              "produced"
            ],
            "description": "whether the project INGESTED or PRODUCED this target"
          },
          "targetKind": {
            "type": "string",
            "description": "the target's registry, e.g. 'content.markdown'"
          },
          "targetId": {
            "type": "string",
            "description": "the opaque target id"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true,
            "description": "set when un-linked (soft delete); null for a live link"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "target": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TargetDescriptor"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PersonaMemory": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "customerId",
          "personaId",
          "scope",
          "slug",
          "memoryType",
          "description",
          "body",
          "status",
          "source",
          "confidence",
          "tags",
          "recallCount",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string",
            "description": "Ecosystem (tenant) id"
          },
          "customerId": {
            "type": "string",
            "description": "Owning user; empty for a global memory"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "personaId": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "user",
              "persona"
            ]
          },
          "slug": {
            "type": "string"
          },
          "memoryType": {
            "type": "string",
            "enum": [
              "user",
              "feedback",
              "project",
              "reference"
            ]
          },
          "description": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "subjectTable": {
            "type": "string",
            "nullable": true
          },
          "subjectId": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "superseded",
              "archived"
            ]
          },
          "supersedesId": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "enum": [
              "inferred",
              "user_stated",
              "tool"
            ]
          },
          "confidence": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "validFrom": {
            "type": "string",
            "nullable": true
          },
          "validTo": {
            "type": "string",
            "nullable": true
          },
          "recallCount": {
            "type": "integer"
          },
          "lastRecalledAt": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "PersonaMemoryMatch": {
        "type": "object",
        "required": [
          "id",
          "personaId",
          "scope",
          "slug",
          "memoryType",
          "description",
          "body",
          "confidence",
          "tags",
          "similarity"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "personaId": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "user",
              "persona"
            ]
          },
          "slug": {
            "type": "string"
          },
          "memoryType": {
            "type": "string",
            "enum": [
              "user",
              "feedback",
              "project",
              "reference"
            ]
          },
          "description": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "confidence": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "similarity": {
            "type": "number",
            "nullable": true,
            "minimum": 0,
            "maximum": 1,
            "description": "Cosine similarity, negatives clamped to 0; null for a keyword hit"
          }
        }
      },
      "PersonaMemoryRecallResult": {
        "type": "object",
        "required": [
          "memories"
        ],
        "properties": {
          "memories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonaMemoryMatch"
            }
          }
        }
      },
      "PersonaService": {
        "type": "object",
        "required": [
          "id",
          "providerKind",
          "name",
          "baseUrl",
          "hasApiKey",
          "connectStatus",
          "models"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "templateId": {
            "type": "string",
            "nullable": true
          },
          "providerKind": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "baseUrl": {
            "type": "string"
          },
          "hasApiKey": {
            "type": "boolean"
          },
          "connectStatus": {
            "type": "string"
          },
          "connectError": {
            "type": "string",
            "nullable": true
          },
          "lastConnectedAt": {
            "type": "string",
            "nullable": true
          },
          "documentationUrl": {
            "type": "string",
            "nullable": true
          },
          "statusUrl": {
            "type": "string",
            "nullable": true
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonaServiceModel"
            }
          },
          "modelsFetchedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PersonaServiceModel": {
        "oneOf": [
          {
            "type": "string",
            "description": "Model id"
          },
          {
            "type": "object",
            "additionalProperties": true,
            "description": "Model descriptor"
          }
        ]
      },
      "ProviderTemplateModel": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "metadata",
          "source",
          "lastSyncedAt",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "source": {
            "type": "string",
            "enum": [
              "curated",
              "synced"
            ]
          },
          "lastSyncedAt": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "ProviderTemplate": {
        "type": "object",
        "required": [
          "id",
          "providerKind",
          "name",
          "baseUrl",
          "documentationUrl",
          "statusUrl",
          "connectionSpec",
          "createdAt",
          "updatedAt",
          "models",
          "availableVia",
          "modalities"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "providerKind": {
            "type": "string",
            "enum": [
              "openai",
              "anthropic",
              "gemini",
              "external"
            ]
          },
          "name": {
            "type": "string"
          },
          "baseUrl": {
            "type": "string"
          },
          "documentationUrl": {
            "type": "string",
            "nullable": true
          },
          "statusUrl": {
            "type": "string",
            "nullable": true
          },
          "connectionSpec": {
            "$ref": "#/components/schemas/ProviderConnectionSpec"
          },
          "availableVia": {
            "$ref": "#/components/schemas/TemplateAvailableVia"
          },
          "modalities": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "chat",
                "image",
                "video"
              ]
            },
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderTemplateModel"
            }
          }
        }
      },
      "TemplateSyncKeys": {
        "type": "object",
        "nullable": true,
        "additionalProperties": false,
        "description": "Operator-only upstream sync mapping — never present on public reads.",
        "properties": {
          "modelsDev": {
            "type": "string",
            "maxLength": 120
          },
          "openrouter": {
            "type": "string",
            "maxLength": 120
          },
          "arenaVendor": {
            "type": "string",
            "maxLength": 120
          }
        }
      },
      "TemplateAvailableVia": {
        "type": "object",
        "nullable": true,
        "additionalProperties": false,
        "required": [
          "note",
          "templates"
        ],
        "description": "Set ⇒ informational template: no first-party API; connect via the named templates.",
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 500
          },
          "templates": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 120
            }
          }
        }
      },
      "CatalogSyncOutcome": {
        "type": "object",
        "required": [
          "source",
          "ok",
          "templatesTouched",
          "modelsUpserted",
          "modelsDeleted"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "modelsDev",
              "openrouter",
              "arena"
            ]
          },
          "ok": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "templatesTouched": {
            "type": "integer"
          },
          "modelsUpserted": {
            "type": "integer"
          },
          "modelsDeleted": {
            "type": "integer"
          }
        }
      },
      "CatalogSyncRun": {
        "type": "object",
        "required": [
          "source",
          "lastRunAt",
          "ok"
        ],
        "properties": {
          "source": {
            "type": "string"
          },
          "lastRunAt": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "detail": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          }
        }
      },
      "ProviderConnectionUrlVar": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "example": {
            "type": "string"
          },
          "secret": {
            "type": "boolean"
          }
        }
      },
      "ProviderConnectionHeaderVar": {
        "type": "object",
        "required": [
          "header"
        ],
        "properties": {
          "header": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "example": {
            "type": "string"
          },
          "secret": {
            "type": "boolean"
          }
        }
      },
      "ProviderConnectionStringMap": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        }
      },
      "ProviderConnectionAuth": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "bearer",
              "header",
              "sigv4",
              "oauth2"
            ]
          },
          "header": {
            "type": "string",
            "description": "header auth: the header name (e.g. api-key)"
          },
          "scheme": {
            "type": "string",
            "enum": [
              "bearer",
              "raw"
            ]
          },
          "region": {
            "type": "string",
            "description": "sigv4 (reserved)"
          },
          "tokenUrl": {
            "type": "string",
            "description": "oauth2 (reserved)"
          }
        }
      },
      "ProviderConnectionSpec": {
        "type": "object",
        "nullable": true,
        "required": [
          "specVersion"
        ],
        "properties": {
          "specVersion": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "urlVars": {
            "type": "array",
            "description": "base_url placeholders the connect UI prompts for and substitutes.",
            "items": {
              "$ref": "#/components/schemas/ProviderConnectionUrlVar"
            }
          },
          "headerVars": {
            "type": "array",
            "description": "headers the connect UI prompts a per-connection value for and writes into extraHeaders.",
            "items": {
              "$ref": "#/components/schemas/ProviderConnectionHeaderVar"
            }
          },
          "auth": {
            "$ref": "#/components/schemas/ProviderConnectionAuth"
          },
          "defaultQuery": {
            "$ref": "#/components/schemas/ProviderConnectionStringMap"
          },
          "extraHeaders": {
            "$ref": "#/components/schemas/ProviderConnectionStringMap"
          }
        }
      },
      "ProviderTemplateList": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderTemplate"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          }
        }
      },
      "ProviderTemplateVerifyResult": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonaServiceModel"
            }
          },
          "error": {
            "type": "string"
          }
        }
      },
      "PublicOwner": {
        "type": "object",
        "nullable": true,
        "required": [
          "slug",
          "displayName",
          "avatarUrl"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PublicPersona": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "description",
          "modelPrompt",
          "provider",
          "model",
          "avatarUrl",
          "voice",
          "character",
          "examples",
          "visibility",
          "createdAt",
          "owner",
          "demoEnabled"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "modelPrompt": {
            "type": "string"
          },
          "provider": {
            "type": "string",
            "nullable": true
          },
          "model": {
            "type": "string"
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          },
          "voice": {
            "type": "string",
            "nullable": true
          },
          "character": {
            "type": "string",
            "nullable": true
          },
          "examples": {
            "type": "string",
            "nullable": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "hub"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/PublicOwner"
          },
          "demoEnabled": {
            "type": "boolean"
          },
          "chatStatus": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "description": "Per-persona chat status configuration: word pairs, glyph sets and tint. Resolved and rendered client-side."
          }
        }
      },
      "PersonaSheet": {
        "type": "object",
        "required": [
          "subjectType",
          "subjectId",
          "skin",
          "xp",
          "level",
          "levelTitle",
          "xpIntoLevel",
          "xpForNext",
          "tenureDays",
          "streakDays",
          "stats",
          "trend",
          "badges"
        ],
        "properties": {
          "subjectType": {
            "type": "string",
            "enum": [
              "persona"
            ]
          },
          "subjectId": {
            "type": "string"
          },
          "skin": {
            "type": "string"
          },
          "xp": {
            "type": "integer"
          },
          "level": {
            "type": "integer"
          },
          "levelTitle": {
            "type": "string",
            "nullable": true
          },
          "xpIntoLevel": {
            "type": "integer"
          },
          "xpForNext": {
            "type": "integer"
          },
          "tenureDays": {
            "type": "integer"
          },
          "streakDays": {
            "type": "integer"
          },
          "stats": {
            "type": "object",
            "required": [
              "adventures",
              "allies",
              "turns",
              "tokensOut",
              "avgLatencyMs",
              "daysActive"
            ],
            "properties": {
              "adventures": {
                "type": "integer"
              },
              "allies": {
                "type": "integer"
              },
              "turns": {
                "type": "integer"
              },
              "tokensOut": {
                "type": "integer"
              },
              "avgLatencyMs": {
                "type": "integer",
                "nullable": true
              },
              "daysActive": {
                "type": "integer"
              }
            }
          },
          "trend": {
            "type": "object",
            "required": [
              "adventures7d"
            ],
            "properties": {
              "adventures7d": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              }
            }
          },
          "badges": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "badgeId",
                "name",
                "description",
                "icon",
                "tier",
                "badgeLine",
                "awardedAt",
                "rarityPct"
              ],
              "properties": {
                "badgeId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "icon": {
                  "type": "string"
                },
                "tier": {
                  "type": "string"
                },
                "badgeLine": {
                  "type": "string",
                  "nullable": true
                },
                "awardedAt": {
                  "type": "string"
                },
                "rarityPct": {
                  "type": "number",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "SubjectSheet": {
        "type": "object",
        "required": [
          "subjectType",
          "subjectId",
          "skin",
          "xp",
          "level",
          "levelTitle",
          "xpIntoLevel",
          "xpForNext",
          "tenureDays",
          "streakDays",
          "stats",
          "trend",
          "badges"
        ],
        "properties": {
          "subjectType": {
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          },
          "skin": {
            "type": "string"
          },
          "xp": {
            "type": "integer"
          },
          "level": {
            "type": "integer"
          },
          "levelTitle": {
            "type": "string",
            "nullable": true
          },
          "xpIntoLevel": {
            "type": "integer"
          },
          "xpForNext": {
            "type": "integer"
          },
          "tenureDays": {
            "type": "integer"
          },
          "streakDays": {
            "type": "integer"
          },
          "stats": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "nullable": true
            }
          },
          "trend": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            }
          },
          "badges": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "badgeId",
                "name",
                "description",
                "icon",
                "tier",
                "badgeLine",
                "awardedAt",
                "rarityPct"
              ],
              "properties": {
                "badgeId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "icon": {
                  "type": "string"
                },
                "tier": {
                  "type": "string"
                },
                "badgeLine": {
                  "type": "string",
                  "nullable": true
                },
                "awardedAt": {
                  "type": "string"
                },
                "rarityPct": {
                  "type": "number",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "OrgSheet": {
        "type": "object",
        "required": [
          "subjectType",
          "subjectId",
          "name",
          "slug",
          "skin",
          "level",
          "levelTitle",
          "xp",
          "xpIntoLevel",
          "xpForNext",
          "memberCount",
          "stats"
        ],
        "properties": {
          "subjectType": {
            "type": "string",
            "enum": [
              "org"
            ]
          },
          "subjectId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "skin": {
            "type": "string"
          },
          "level": {
            "type": "integer"
          },
          "levelTitle": {
            "type": "string",
            "nullable": true
          },
          "xp": {
            "type": "integer"
          },
          "xpIntoLevel": {
            "type": "integer"
          },
          "xpForNext": {
            "type": "integer"
          },
          "memberCount": {
            "type": "integer"
          },
          "stats": {
            "type": "object",
            "required": [
              "personasPublished",
              "daysActive"
            ],
            "properties": {
              "personasPublished": {
                "type": "integer"
              },
              "daysActive": {
                "type": "integer"
              }
            }
          }
        }
      },
      "PersonaWeeklyRecap": {
        "type": "object",
        "required": [
          "weekStart",
          "adventures",
          "newAllies",
          "reflexesDeltaPct",
          "levelsGained"
        ],
        "properties": {
          "weekStart": {
            "type": "string"
          },
          "adventures": {
            "type": "integer"
          },
          "newAllies": {
            "type": "integer"
          },
          "reflexesDeltaPct": {
            "type": "number",
            "nullable": true
          },
          "levelsGained": {
            "type": "integer"
          }
        }
      },
      "GamificationLeague": {
        "type": "object",
        "required": [
          "statKey",
          "league",
          "entries"
        ],
        "properties": {
          "statKey": {
            "type": "string",
            "enum": [
              "adventures",
              "allies",
              "days_active"
            ]
          },
          "league": {
            "type": "integer",
            "description": "Zero-based league cohort (30 ranks each, by season standing)."
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GamificationBoardEntry"
            }
          }
        }
      },
      "PublicPersonaSummary": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "description",
          "visibility",
          "createdAt",
          "owner"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "hub"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/PublicOwner"
          }
        }
      },
      "PublicSocialLink": {
        "type": "object",
        "required": [
          "platform",
          "url",
          "handle"
        ],
        "properties": {
          "platform": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "handle": {
            "type": "string"
          }
        }
      },
      "PublicAddress": {
        "type": "object",
        "required": [
          "label",
          "line1",
          "line2",
          "city",
          "region",
          "postalCode",
          "country"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        }
      },
      "PublicUserSearchHit": {
        "type": "object",
        "required": [
          "slug",
          "displayName",
          "avatarUrl",
          "kind"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          },
          "kind": {
            "type": "string",
            "enum": [
              "user",
              "organization"
            ]
          }
        }
      },
      "PublicUserProfile": {
        "type": "object",
        "required": [
          "slug",
          "displayName",
          "avatarUrl",
          "createdAt",
          "socialLinks",
          "emails",
          "phones",
          "addresses",
          "personas"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "socialLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSocialLink"
            }
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicAddress"
            }
          },
          "personas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicPersonaSummary"
            }
          }
        }
      },
      "PublicOrgProfile": {
        "type": "object",
        "required": [
          "slug",
          "displayName",
          "description",
          "createdAt",
          "personas"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "personas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicPersonaSummary"
            }
          }
        }
      },
      "PublicPaperSummary": {
        "type": "object",
        "required": [
          "route",
          "title",
          "category",
          "tags",
          "updatedAt"
        ],
        "properties": {
          "route": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "PublicPaperSearchHit": {
        "type": "object",
        "required": [
          "id",
          "title",
          "kind",
          "publicRoute",
          "author",
          "category",
          "tags",
          "summary",
          "evaluation",
          "snippet",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "paper",
              "research"
            ],
            "description": "Document kind: 'paper' (ordinary) or 'research' (AI-ingested)."
          },
          "publicRoute": {
            "type": "string",
            "description": "Published route slug; link as /public/users/{author.slug}/papers/{publicRoute}."
          },
          "author": {
            "type": "object",
            "required": [
              "slug",
              "displayName"
            ],
            "properties": {
              "slug": {
                "type": "string"
              },
              "displayName": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "summary": {
            "type": "string",
            "nullable": true,
            "description": "Display summary read from the doc frontmatter (jsonb), or null."
          },
          "evaluation": {
            "type": "string",
            "nullable": true,
            "description": "Display evaluation read from the doc frontmatter (jsonb), or null."
          },
          "snippet": {
            "type": "string",
            "description": "~200-char match-context excerpt around the first q hit (head of content when q is empty/absent)."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "PublicPaper": {
        "type": "object",
        "required": [
          "route",
          "title",
          "category",
          "tags",
          "content",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "route": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "content": {
            "type": "string",
            "description": "Full raw markdown, byte-exact."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "PublicRegistrySummary": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "purpose",
          "categoryRoot",
          "tags"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "purpose": {
            "type": "string",
            "description": "One-line \"what this registry is for\"."
          },
          "categoryRoot": {
            "type": "string",
            "description": "The industry half of <industry>.<service-type>, e.g. 'software'."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The owner's discovery labels."
          }
        }
      },
      "PublicRegistryDirectory": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicRegistrySummary"
            }
          },
          "total": {
            "type": "integer",
            "description": "Public registries in total, not just on this page — so a caller reading only page 1 can tell a short directory from a truncated one."
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          }
        }
      },
      "PublicRegistrySection": {
        "type": "object",
        "required": [
          "key",
          "label",
          "description",
          "sortOrder"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer"
          }
        }
      },
      "PublicRegistryFieldDef": {
        "type": "object",
        "required": [
          "key",
          "label",
          "type",
          "sortOrder"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer"
          }
        }
      },
      "PublicRegistry": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "purpose",
          "description",
          "categoryRoot",
          "entryTerm",
          "tags",
          "servicesEnabled",
          "boundSiteId",
          "sections",
          "fields"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "purpose": {
            "type": "string",
            "description": "One-line \"what this registry is for\"."
          },
          "description": {
            "type": "string"
          },
          "categoryRoot": {
            "type": "string",
            "description": "The industry half of <industry>.<service-type>, e.g. 'software'."
          },
          "entryTerm": {
            "type": "string",
            "description": "What this registry calls an entry — \"consultant\", \"coach\", \"shop\"."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The owner's discovery labels."
          },
          "servicesEnabled": {
            "type": "boolean"
          },
          "boundSiteId": {
            "type": "string",
            "nullable": true,
            "description": "A fleet SITE SLUG from the frontend sites registry, when this registry is bound to a dedicated site; null otherwise."
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicRegistrySection"
            }
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicRegistryFieldDef"
            }
          }
        }
      },
      "PublicRegistryEntrySummary": {
        "type": "object",
        "required": [
          "slug",
          "displayName",
          "summary",
          "category",
          "keywords",
          "locationText",
          "deliveryMode",
          "photoAttachmentId"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locationText": {
            "type": "string"
          },
          "deliveryMode": {
            "type": "string",
            "enum": [
              "in_person",
              "virtual",
              "hybrid"
            ]
          },
          "photoAttachmentId": {
            "type": "string",
            "nullable": true,
            "description": "An attachment id, not a URL — look it up in the response's `imageUrls`. Null whenever no URL could be produced for THIS entry (no photo set, or one that is missing, unready, not owned by this entry, or unpresignable — including a deployment with no object store), so an id that is present always has a URL in the map. Render the card without a picture when it is null."
          }
        }
      },
      "PublicRegistryEntryList": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "pageSize",
          "imageUrls"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicRegistryEntrySummary"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          },
          "imageUrls": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Attachment id -> presigned GET URL, for the photos on THIS page. One map per page rather than a URL per item: two entries may not share a photo, but one map keyed by id matches the entry-detail shape and costs nothing to look up. Short-lived (15 min), and empty when object storage is not configured."
          }
        }
      },
      "PublicRegistryField": {
        "type": "object",
        "required": [
          "key",
          "label",
          "type",
          "value",
          "visibility"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "value": {},
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "authenticated"
            ],
            "description": "The EFFECTIVE audience for this value — the tighter of the registry owner’s ceiling for the field and the registrant’s own override on this entry. A client renders it as the \"who can see this\" marker; it is not the def’s configured setting, which may be wider."
          }
        }
      },
      "PublicRegistryService": {
        "type": "object",
        "required": [
          "title",
          "description",
          "pricingModel",
          "priceMin",
          "priceMax",
          "currency",
          "unit",
          "deliveryMode"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "pricingModel": {
            "type": "string",
            "enum": [
              "hourly",
              "per_job",
              "per_deliverable",
              "subscription",
              "free",
              "barter"
            ]
          },
          "priceMin": {
            "type": "integer",
            "nullable": true
          },
          "priceMax": {
            "type": "integer",
            "nullable": true
          },
          "currency": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "deliveryMode": {
            "type": "string",
            "enum": [
              "in_person",
              "virtual",
              "hybrid"
            ]
          }
        }
      },
      "PublicRegistryEntryDetail": {
        "type": "object",
        "required": [
          "slug",
          "displayName",
          "summary",
          "photoAttachmentId",
          "providerType",
          "category",
          "keywords",
          "locationText",
          "countryCode",
          "regionCode",
          "geo",
          "areaServed",
          "deliveryMode",
          "links",
          "contactMode",
          "languages",
          "fields",
          "services",
          "imageUrls"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "photoAttachmentId": {
            "type": "string",
            "nullable": true
          },
          "providerType": {
            "type": "string",
            "enum": [
              "person",
              "organization",
              "persona"
            ]
          },
          "category": {
            "type": "string"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locationText": {
            "type": "string"
          },
          "countryCode": {
            "type": "string"
          },
          "regionCode": {
            "type": "string"
          },
          "geo": {
            "type": "object",
            "nullable": true,
            "required": [
              "lat",
              "lon"
            ],
            "properties": {
              "lat": {
                "type": "number"
              },
              "lon": {
                "type": "number"
              }
            }
          },
          "areaServed": {
            "type": "object",
            "additionalProperties": true
          },
          "deliveryMode": {
            "type": "string",
            "enum": [
              "in_person",
              "virtual",
              "hybrid"
            ]
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "url"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "contactMode": {
            "type": "string",
            "enum": [
              "dm",
              "none"
            ],
            "description": "Never a raw email or phone — contact is DM-only."
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicRegistryField"
            }
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicRegistryService"
            }
          },
          "imageUrls": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Attachment id -> presigned GET URL, for the photo and every public image field. Short-lived (15 min); absent entirely when object storage is not configured."
          }
        }
      },
      "PublicRegistryEntryResponse": {
        "type": "object",
        "required": [
          "registry",
          "entry",
          "jsonLd"
        ],
        "properties": {
          "registry": {
            "type": "object",
            "required": [
              "slug",
              "name",
              "boundSiteId"
            ],
            "properties": {
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "boundSiteId": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "entry": {
            "$ref": "#/components/schemas/PublicRegistryEntryDetail"
          },
          "jsonLd": {
            "type": "object",
            "additionalProperties": true,
            "description": "schema.org markup from entryJsonLd, including a resolved url — the route derives the entry's canonical base (host AND path prefix) from the backend's vendored sites registry (publicEntryBaseFor) before building this object, so the page only needs to place it verbatim in a <script type=\"application/ld+json\"> tag."
          }
        }
      },
      "PublicRegistrySitemap": {
        "type": "object",
        "required": [
          "slugs"
        ],
        "properties": {
          "slugs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Public entry slugs, alphabetical."
          }
        }
      },
      "VisitorToken": {
        "type": "object",
        "required": [
          "token",
          "expiresAt",
          "personaId"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "The bearer token itself, `tmp_` followed by 64 hex characters. Returned once at mint and stored only as a hash — it cannot be recovered."
          },
          "expiresAt": {
            "type": "string"
          },
          "personaId": {
            "type": "string"
          }
        }
      },
      "VisitorConversationCreate": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Defaults to \"New chat\""
          }
        }
      },
      "VisitorConversation": {
        "type": "object",
        "required": [
          "id",
          "title",
          "model",
          "personaSlug",
          "personaId",
          "state",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "model": {
            "type": "string",
            "description": "The persona's configured model, copied at creation"
          },
          "personaSlug": {
            "type": "string",
            "nullable": true
          },
          "personaId": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "VisitorMessage": {
        "type": "object",
        "required": [
          "id",
          "role",
          "content",
          "toolName",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "toolName": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "VisitorConversationDetail": {
        "type": "object",
        "required": [
          "conversation",
          "messages"
        ],
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/VisitorConversation"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VisitorMessage"
            }
          }
        }
      },
      "VisitorTurnRequest": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "description": "Over the per-message character ceiling this is a 422, not a 400"
          },
          "clientMessageId": {
            "type": "string"
          }
        }
      },
      "VisitorTurnEvent": {
        "description": "One event in the visitor turn stream. The SSE `event:` name is the discriminator (`open` | `token` | `tool_call_started` | `tool_call_completed` | `status` | `award` | `done` | `ended` | `error`); the JSON `data:` payload is one of the shapes below.",
        "oneOf": [
          {
            "title": "VisitorOpenEvent",
            "type": "object",
            "description": "open — the stream is live (empty payload)"
          },
          {
            "title": "VisitorTokenEvent",
            "type": "object",
            "description": "token — a chunk of streamed text",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string"
              }
            }
          },
          {
            "title": "VisitorToolCallStartedEvent",
            "type": "object",
            "description": "tool_call_started — the persona invoked a tool",
            "required": [
              "name",
              "arguments"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "arguments": {
                "type": "string"
              }
            }
          },
          {
            "title": "VisitorToolCallCompletedEvent",
            "type": "object",
            "description": "tool_call_completed — a tool finished",
            "required": [
              "name",
              "ok",
              "result"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "ok": {
                "type": "boolean"
              },
              "result": {
                "type": "string"
              }
            }
          },
          {
            "title": "VisitorStatusEvent",
            "type": "object",
            "description": "status — the turn is being retried; not an error yet",
            "required": [
              "phase",
              "attempt"
            ],
            "properties": {
              "phase": {
                "type": "string",
                "enum": [
                  "retrying"
                ]
              },
              "attempt": {
                "type": "integer"
              }
            }
          },
          {
            "title": "VisitorAwardEvent",
            "type": "object",
            "description": "award — the turn earned badges or XP",
            "required": [
              "badges",
              "xpGained",
              "leveledUpTo"
            ],
            "properties": {
              "badges": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/VisitorAwardBadge"
                }
              },
              "xpGained": {
                "type": "integer"
              },
              "leveledUpTo": {
                "type": "integer",
                "nullable": true
              }
            }
          },
          {
            "title": "VisitorDoneEvent",
            "type": "object",
            "description": "done — the turn completed (empty payload)"
          },
          {
            "title": "VisitorEndedEvent",
            "type": "object",
            "description": "ended — the persona closed the conversation; further turns are 409",
            "required": [
              "reason"
            ],
            "properties": {
              "reason": {
                "type": "string"
              }
            }
          },
          {
            "title": "VisitorErrorEvent",
            "type": "object",
            "description": "error — the turn failed. Internal causes are replaced with generic copy.",
            "required": [
              "message"
            ],
            "properties": {
              "message": {
                "type": "string"
              }
            }
          }
        ]
      },
      "VisitorAwardBadge": {
        "type": "object",
        "required": [
          "badgeId",
          "name",
          "icon",
          "tier",
          "description"
        ],
        "properties": {
          "badgeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "tier": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "RegistryIdentifier": {
        "type": "object",
        "required": [
          "rdid",
          "entityType",
          "entityId",
          "createdBy"
        ],
        "properties": {
          "rdid": {
            "type": "string",
            "description": "Reverse-domain identifier (e.g. com.acme.app)"
          },
          "entityType": {
            "type": "string",
            "description": "e.g. 'namespace', 'ecosystem', 'organization'"
          },
          "entityId": {
            "type": "string",
            "description": "The UUID the rdid resolves to"
          },
          "createdBy": {
            "type": "string",
            "nullable": true,
            "description": "Minter; null for system mappings"
          }
        }
      },
      "RegistryNamespace": {
        "type": "object",
        "required": [
          "id",
          "ownerKind",
          "ownerId",
          "slug",
          "name",
          "rdid"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ownerKind": {
            "type": "string",
            "enum": [
              "customer",
              "organization",
              "persona",
              "ecosystem"
            ]
          },
          "ownerId": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "rdid": {
            "type": "string",
            "nullable": true,
            "description": "Always null for a namespace created after Task 5 (rdid-addressing-model); non-null only on rows minted before it"
          }
        }
      },
      "RegistryNamespaceUpdate": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "RegistryOrganization": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 1000
          },
          "rdid": {
            "type": "string",
            "description": "org.<slug> — present on the POST create response; absent on plain GET/PATCH"
          }
        }
      },
      "RegistryEcosystem": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "rdid"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "rdid": {
            "type": "string",
            "description": "ecosystem.<slug> for a root ecosystem, or ecosystem.<parent path>.<slug> for a child"
          }
        }
      },
      "RegistryProvisionedOrganization": {
        "type": "object",
        "required": [
          "organization",
          "namespace",
          "teamId",
          "ecosystem",
          "hubData"
        ],
        "properties": {
          "organization": {
            "$ref": "#/components/schemas/RegistryOrganization"
          },
          "namespace": {
            "$ref": "#/components/schemas/RegistryNamespace"
          },
          "teamId": {
            "type": "string",
            "description": "The provisioned admin team id"
          },
          "ecosystem": {
            "$ref": "#/components/schemas/RegistryEcosystem"
          },
          "hubData": {
            "type": "object",
            "description": "The org's Organization ecosystem: the child of its workspace that holds the org's own data — Notes, Research, Documents, Integrations, Planning, Storage",
            "required": [
              "id",
              "slug",
              "rdid"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "slug": {
                "type": "string",
                "description": "Always `organization`"
              },
              "rdid": {
                "type": "string",
                "description": "ecosystem.<workspace path>.organization"
              }
            }
          }
        }
      },
      "RegistryPersonaApproval": {
        "type": "object",
        "required": [
          "id",
          "personaId",
          "subjectKind",
          "subjectEco",
          "toolName",
          "args",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "personaId": {
            "type": "string"
          },
          "subjectKind": {
            "type": "string",
            "enum": [
              "self",
              "user",
              "team",
              "org"
            ]
          },
          "subjectId": {
            "type": "string",
            "nullable": true,
            "description": "null for self/eco-scoped subjects"
          },
          "subjectEco": {
            "type": "string"
          },
          "toolName": {
            "type": "string",
            "description": "curated tool name, or the gateway tool 'adh_request'"
          },
          "args": {
            "type": "object",
            "additionalProperties": true,
            "description": "the frozen invocation payload"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ]
          },
          "requestedBy": {
            "type": "string",
            "nullable": true
          },
          "decidedBy": {
            "type": "string",
            "nullable": true,
            "description": "the human who decided (null until then)"
          },
          "decidedAt": {
            "type": "string",
            "nullable": true
          },
          "result": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true,
            "description": "the outcome once an approved action runs (null until then)"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "RegistryPersonaToolGrant": {
        "type": "object",
        "required": [
          "toolName",
          "autonomous",
          "createdAt"
        ],
        "properties": {
          "toolName": {
            "type": "string"
          },
          "autonomous": {
            "type": "boolean",
            "description": "true = this grant skips the approval gate (except acting as self, which always gates)"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "RegistryPersonaToolCatalogItem": {
        "type": "object",
        "required": [
          "toolName",
          "source",
          "displayName",
          "description",
          "readOnly",
          "granted",
          "autonomous"
        ],
        "properties": {
          "toolName": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "nullable": true,
            "description": "null for curated internal tools; else the source id (e.g. \"web\", \"mcp.<server>\")"
          },
          "displayName": {
            "type": "string",
            "description": "human-readable label from the tool catalog (persona.tool_templates); falls back to toolName when no catalog row exists"
          },
          "description": {
            "type": "string",
            "description": "human-readable description from the tool catalog; '' when no catalog row exists"
          },
          "readOnly": {
            "type": "boolean"
          },
          "granted": {
            "type": "boolean",
            "description": "true iff this persona currently holds the tool"
          },
          "autonomous": {
            "type": "boolean",
            "description": "true = this grant skips the approval gate (except acting as self, which always gates); false when not granted"
          }
        }
      },
      "RegistryPersonaUserTool": {
        "type": "object",
        "required": [
          "toolName",
          "source",
          "displayName",
          "description",
          "readOnly",
          "allowed"
        ],
        "properties": {
          "toolName": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "nullable": true,
            "description": "null for curated internal tools; else the source id (e.g. \"web\", \"mcp.<server>\")"
          },
          "displayName": {
            "type": "string",
            "description": "human-readable label from the tool catalog (persona.tool_templates); falls back to toolName when no catalog row exists"
          },
          "description": {
            "type": "string",
            "description": "human-readable description from the tool catalog; '' when no catalog row exists"
          },
          "readOnly": {
            "type": "boolean"
          },
          "allowed": {
            "type": "boolean",
            "description": "true iff the calling user has allowed the persona to invoke this tool for them"
          }
        }
      },
      "RegistryUserActablePersona": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "RegistryPersonaMayAct": {
        "type": "object",
        "required": [
          "kinds"
        ],
        "properties": {
          "kinds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "self",
                "user",
                "team",
                "org"
              ]
            },
            "description": "the subject kinds this persona may act for (always includes 'self')"
          }
        }
      },
      "RegistryPersonaToken": {
        "type": "object",
        "required": [
          "id",
          "name",
          "prefix",
          "createdAt",
          "expiresAt",
          "lastUsedAt",
          "personaId"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "description": "Non-secret leading chars, for display"
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "nullable": true
          },
          "lastUsedAt": {
            "type": "string",
            "nullable": true,
            "description": "null until the token first authenticates"
          },
          "personaId": {
            "type": "string",
            "nullable": true,
            "description": "The persona this token authenticates AS"
          }
        }
      },
      "RegistryPersonaTokenCreated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RegistryPersonaToken"
          },
          {
            "type": "object",
            "required": [
              "token"
            ],
            "properties": {
              "token": {
                "type": "string",
                "description": "The raw token value — shown exactly once, on mint"
              }
            }
          }
        ]
      },
      "RegistryAgentMcpServer": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "url",
          "enabled",
          "hasAuthSecret",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The `<server>` segment in `mcp.<server>.<tool>`"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "The remote MCP server's http(s) endpoint URL"
          },
          "enabled": {
            "type": "boolean",
            "description": "Opt-in: a server contributes no tools until an operator enables it"
          },
          "hasAuthSecret": {
            "type": "boolean",
            "description": "true iff a per-server bearer secret is stored; the secret itself is NEVER returned"
          },
          "createdBy": {
            "type": "string",
            "nullable": true,
            "description": "The admin who registered it (null for system rows)"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "Registry": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "ownerKind",
          "ownerId",
          "slug",
          "name",
          "purpose",
          "description",
          "categoryRoot",
          "entryTerm",
          "tags",
          "visibility",
          "submissionPolicy",
          "servicesEnabled",
          "createdAt",
          "updatedAt",
          "syncVersion"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "ownerKind": {
            "type": "string",
            "enum": [
              "customer",
              "organization"
            ]
          },
          "ownerId": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "globally unique path segment on the registries site"
          },
          "name": {
            "type": "string"
          },
          "purpose": {
            "type": "string",
            "description": "the one-line \"what this registry is for\""
          },
          "description": {
            "type": "string"
          },
          "categoryRoot": {
            "type": "string",
            "description": "the industry half of <industry>.<service-type>"
          },
          "entryTerm": {
            "type": "string",
            "description": "what this registry calls an entry, e.g. \"coach\""
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "maxItems": 32,
            "description": "Discovery labels the owner puts on the registry. A SET: the server trims each label and drops duplicates, so what comes back is not necessarily what was sent."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "hub",
              "private"
            ]
          },
          "submissionPolicy": {
            "type": "string",
            "enum": [
              "open",
              "reviewed"
            ]
          },
          "boundSiteId": {
            "type": "string",
            "nullable": true,
            "description": "a fleet SITE SLUG this registry is bound to; set by platform admin only, never via this API"
          },
          "servicesEnabled": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "RegistrySection": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "registryId",
          "key",
          "label",
          "description",
          "sortOrder",
          "createdAt",
          "updatedAt",
          "syncVersion"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "registryId": {
            "type": "string"
          },
          "key": {
            "type": "string",
            "description": "unique within the registry; create-only — the update schema omits it, matching field_defs.key"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "RegistryFieldDef": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "registryId",
          "sectionId",
          "key",
          "type",
          "label",
          "help",
          "required",
          "sortOrder",
          "config",
          "visibility",
          "createdAt",
          "updatedAt",
          "syncVersion"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "registryId": {
            "type": "string"
          },
          "sectionId": {
            "type": "string"
          },
          "key": {
            "type": "string",
            "description": "IMMUTABLE — the key under which values are stored in entries.values"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "textarea",
              "markdown",
              "select",
              "multi_select",
              "url",
              "email",
              "phone",
              "boolean",
              "date",
              "image",
              "address"
            ],
            "description": "IMMUTABLE — a member of the field-type catalog (vendor/registry-types.ts)"
          },
          "label": {
            "type": "string"
          },
          "help": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer"
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "per-type config: select options, min/max, accepted image types"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "authenticated",
              "private"
            ],
            "description": "The owner's CEILING for this field across every entry, widest first: 'public' = anyone including a crawler; 'authenticated' = any signed-in hub member; 'private' = the entry's owner and the registry's owner only. A registrant may TIGHTEN it on their own entry (`valueVisibility` on the entry write) but never loosen it, so the value here is an upper bound on what any entry publishes — not necessarily what a given entry does."
          },
          "showIf": {
            "type": "object",
            "nullable": true,
            "required": [
              "field",
              "op",
              "value"
            ],
            "properties": {
              "field": {
                "type": "string",
                "description": "the key of the field this rule reads"
              },
              "op": {
                "type": "string",
                "enum": [
                  "eq",
                  "ne",
                  "truthy",
                  "falsy",
                  "in",
                  "contains"
                ]
              },
              "value": {
                "description": "JSON value compared against the referenced field (depth <= 8)"
              }
            },
            "description": "a declarative visibility rule, evaluated fail-open (evaluateShowIf)"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "RegistryEntry": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "registryId",
          "ownerKind",
          "ownerId",
          "slug",
          "displayName",
          "summary",
          "providerType",
          "category",
          "keywords",
          "locationText",
          "countryCode",
          "regionCode",
          "areaServed",
          "deliveryMode",
          "links",
          "contactMode",
          "languages",
          "status",
          "visibility",
          "values",
          "valueVisibility",
          "schemaVersion",
          "searchText",
          "createdAt",
          "updatedAt",
          "syncVersion"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "registryId": {
            "type": "string"
          },
          "ownerKind": {
            "type": "string",
            "enum": [
              "customer",
              "organization"
            ]
          },
          "ownerId": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "unique within the registry; the public profile path segment"
          },
          "displayName": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "photoAttachmentId": {
            "type": "string",
            "nullable": true
          },
          "providerType": {
            "type": "string",
            "enum": [
              "person",
              "organization",
              "persona"
            ]
          },
          "category": {
            "type": "string",
            "description": "leaf category, e.g. software.consulting"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locationText": {
            "type": "string"
          },
          "countryCode": {
            "type": "string"
          },
          "regionCode": {
            "type": "string"
          },
          "geo": {
            "type": "object",
            "nullable": true,
            "required": [
              "lat",
              "lon"
            ],
            "properties": {
              "lat": {
                "type": "number"
              },
              "lon": {
                "type": "number"
              }
            }
          },
          "areaServed": {
            "type": "object",
            "additionalProperties": true
          },
          "deliveryMode": {
            "type": "string",
            "enum": [
              "in_person",
              "virtual",
              "hybrid"
            ]
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "url"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "contactMode": {
            "type": "string",
            "enum": [
              "dm",
              "none"
            ],
            "description": "never a raw email or phone — see the schema column comment"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "published"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "hub",
              "private"
            ]
          },
          "values": {
            "type": "object",
            "additionalProperties": true,
            "description": "owner-defined tail, keyed by field_defs.key; shape-validated on every write"
          },
          "valueVisibility": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "public",
                "authenticated",
                "private"
              ]
            },
            "description": "the registrant's per-field audience overrides, keyed by field_defs.key; a key is absent when the field simply follows its def. Never wider than the def allows AS STORED, but read it as the tighter of the two anyway — the owner's ceiling can move after this map is written"
          },
          "schemaVersion": {
            "type": "integer"
          },
          "searchText": {
            "type": "string",
            "description": "derived on write from PUBLIC-visible values only"
          },
          "publishedAt": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "RegistryEntryService": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "entryId",
          "title",
          "description",
          "pricingModel",
          "currency",
          "unit",
          "deliveryMode",
          "sortOrder",
          "createdAt",
          "updatedAt",
          "syncVersion"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "entryId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "pricingModel": {
            "type": "string",
            "enum": [
              "hourly",
              "per_job",
              "per_deliverable",
              "subscription",
              "free",
              "barter"
            ]
          },
          "priceMin": {
            "type": "integer",
            "nullable": true
          },
          "priceMax": {
            "type": "integer",
            "nullable": true
          },
          "currency": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "deliveryMode": {
            "type": "string",
            "enum": [
              "in_person",
              "virtual",
              "hybrid"
            ]
          },
          "sortOrder": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "syncVersion": {
            "type": "integer"
          }
        }
      },
      "RegistryContactResult": {
        "type": "object",
        "required": [
          "chatId"
        ],
        "properties": {
          "chatId": {
            "type": "string",
            "description": "the hub DM chat the opening message was sent into"
          }
        }
      },
      "OrganizationListRow": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 1000
          }
        }
      },
      "EcosystemAuthSettings": {
        "type": "object",
        "description": "An ecosystem's sign-up and sign-in policy. Defaults are returned when nothing has been set.",
        "required": [
          "signupMode",
          "loginEnabled",
          "passwordEnabled",
          "allowedProviders"
        ],
        "properties": {
          "signupMode": {
            "type": "string",
            "enum": [
              "open",
              "invite_only",
              "closed"
            ],
            "description": "Defaults to invite_only"
          },
          "loginEnabled": {
            "type": "boolean",
            "description": "Defaults to true"
          },
          "passwordEnabled": {
            "type": "boolean",
            "description": "Email and password sign-in and sign-up for the customer realm. Defaults to true"
          },
          "allowedProviders": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "null means every configured provider. An empty array is stored as null, never as \"none\"."
          }
        }
      },
      "EcosystemAuthSettingsUpdate": {
        "type": "object",
        "description": "A partial update — supply at least one field. Anything omitted is left as it was.",
        "properties": {
          "signupMode": {
            "type": "string",
            "enum": [
              "open",
              "invite_only",
              "closed"
            ]
          },
          "loginEnabled": {
            "type": "boolean"
          },
          "passwordEnabled": {
            "type": "boolean"
          },
          "allowedProviders": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "nullable": true,
            "description": "Every slug must name a configured provider, or the call is a 400. An empty array is coerced to null (all providers) rather than locking everyone out."
          }
        }
      },
      "ClientAuthRegistration": {
        "type": "object",
        "description": "A login registration: the OIDC client (a Hydra public PKCE client) a website or app signs customers in through. `clientId` is assigned by the server.",
        "required": [
          "clientId",
          "allowedReturnOrigins",
          "redirectUris"
        ],
        "properties": {
          "clientId": {
            "type": "string",
            "description": "The OIDC client_id"
          },
          "allowedReturnOrigins": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "redirectUris": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ClientAuthRegistrationInput": {
        "type": "object",
        "description": "Creates the registration when there is none, updates it when there is. Origins must be bare http(s) origins and are stored canonical; redirect URIs are validated as OAuth redirect URIs. Up to 20 of each. For an application the platform shapes both: a web application redirects to https or loopback http; a native application may also use a custom scheme and has no return origins (any is a 400).",
        "required": [
          "redirectUris"
        ],
        "properties": {
          "allowedReturnOrigins": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "description": "Omitted means none"
          },
          "redirectUris": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20
          }
        }
      },
      "ClientAuthProvider": {
        "type": "object",
        "description": "A configured OAuth provider an ecosystem can switch on. Never carries a secret.",
        "required": [
          "slug",
          "name"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "EcosystemClientAuth": {
        "type": "object",
        "description": "An ecosystem's client auth: its policy, its own login registration, the providers.",
        "required": [
          "settings",
          "registration",
          "providers"
        ],
        "properties": {
          "settings": {
            "$ref": "#/components/schemas/EcosystemAuthSettings"
          },
          "registration": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClientAuthRegistration"
              },
              {
                "type": "null"
              }
            ]
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientAuthProvider"
            }
          }
        }
      },
      "EcosystemClientAuthUpdate": {
        "type": "object",
        "description": "Supply at least one key. `registration: null` removes the ecosystem registration. A registration for the platform ecosystem is a 400.",
        "properties": {
          "settings": {
            "$ref": "#/components/schemas/EcosystemAuthSettingsUpdate"
          },
          "registration": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClientAuthRegistrationInput"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ApplicationClientAuth": {
        "type": "object",
        "description": "An application's client auth. The ecosystem's policy governs every sign-in; `registration` null means the application signs in through the ecosystem's registration.",
        "required": [
          "platform",
          "registration"
        ],
        "properties": {
          "platform": {
            "type": "string",
            "enum": [
              "web",
              "native"
            ],
            "description": "Set on the application itself; it shapes what the registration accepts"
          },
          "registration": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClientAuthRegistration"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ApplicationClientAuthUpdate": {
        "type": "object",
        "description": "`registration: null` removes the application registration.",
        "required": [
          "registration"
        ],
        "properties": {
          "registration": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClientAuthRegistrationInput"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EcosystemSigninApp": {
        "type": "object",
        "description": "An OAuth client that signs users into this ecosystem. The app token is represented by its non-secret prefix only — the secret itself is never part of this shape.",
        "required": [
          "id",
          "slug",
          "name",
          "allowedReturnOrigins",
          "defaultEcosystemId",
          "jwtAudience",
          "isInternal",
          "appTokenPrefix",
          "githubEnabled",
          "redirectUris"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The full client slug, composed server-side as \"<ecosystem>.<leaf>\""
          },
          "name": {
            "type": "string"
          },
          "allowedReturnOrigins": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "defaultEcosystemId": {
            "type": "string"
          },
          "jwtAudience": {
            "type": "string",
            "nullable": true
          },
          "isInternal": {
            "type": "boolean",
            "description": "Always false here — internal clients are not listed or editable"
          },
          "appTokenPrefix": {
            "type": "string",
            "nullable": true
          },
          "githubEnabled": {
            "type": "boolean"
          },
          "redirectUris": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The OAuth redirect URIs registered on the app’s Hydra client. Empty when Hydra is unreachable or not configured (the list never fails on Hydra)."
          }
        }
      },
      "EcosystemSigninAppCreate": {
        "type": "object",
        "required": [
          "slug",
          "name"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",
            "description": "The LEAF only — the stored slug is \"<ecosystem-slug>.<this>\", composed by the server. A composed slug over 100 characters is a 400."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "allowedReturnOrigins": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": [],
            "description": "Bare http(s) origins: no credentials, no path, no query, no fragment. Anything else is a 400."
          },
          "enableGithub": {
            "type": "boolean",
            "default": true
          },
          "redirectUris": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "default": [],
            "description": "OAuth redirect URIs for the app’s Hydra PKCE client: https, loopback http (localhost, 127.0.0.1, [::1]), or a private-use native scheme (com.example.app:/cb). No fragment, no credentials. Anything else is a 400."
          }
        }
      },
      "EcosystemSigninAppUpdate": {
        "type": "object",
        "description": "A partial update — supply at least one field. `slug` and the owning ecosystem are deliberately not patchable: both are identity, not configuration.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "allowedReturnOrigins": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "githubEnabled": {
            "type": "boolean"
          },
          "redirectUris": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "description": "OAuth redirect URIs for the app’s Hydra PKCE client: https, loopback http (localhost, 127.0.0.1, [::1]), or a private-use native scheme (com.example.app:/cb). No fragment, no credentials. Anything else is a 400."
          }
        }
      },
      "PersonaDemoPreviewChoice": {
        "type": "object",
        "required": [
          "text",
          "keywords",
          "offScript"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "The choice's own text, minus its tags"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The words this choice ACTUALLY answers to — resolved from the story, not echoed back from the `# match:` tag. A tag written outside the choice's brackets attaches to something else, and this list is where that becomes visible."
          },
          "offScript": {
            "type": "boolean",
            "description": "The author tagged this choice `# off_script`"
          }
        }
      },
      "PersonaDemoPreviewDiagnostic": {
        "type": "object",
        "required": [
          "severity",
          "line",
          "message"
        ],
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning",
              "info"
            ]
          },
          "line": {
            "type": "integer",
            "nullable": true,
            "description": "1-based source line, if the compiler gave one"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "PersonaBootstrap": {
        "type": "object",
        "description": "Everything an implementation needs to start acting as its persona, in one read: who it is, what to say, what it may touch, and where to talk. Derived entirely from the bearer token — there are no parameters.",
        "required": [
          "persona",
          "prompt",
          "auth",
          "buckets",
          "memory",
          "tools",
          "chat"
        ],
        "properties": {
          "persona": {
            "$ref": "#/components/schemas/PersonaBootstrapPersona"
          },
          "prompt": {
            "$ref": "#/components/schemas/PersonaBootstrapPrompt"
          },
          "auth": {
            "$ref": "#/components/schemas/PersonaBootstrapAuth"
          },
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonaBootstrapBucket"
            }
          },
          "memory": {
            "$ref": "#/components/schemas/PersonaBootstrapMemory"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonaBootstrapTool"
            }
          },
          "chat": {
            "$ref": "#/components/schemas/PersonaBootstrapChat"
          }
        }
      },
      "PersonaBootstrapPersona": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "avatarUrl"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PersonaBootstrapPrompt": {
        "type": "object",
        "required": [
          "system",
          "voice",
          "character"
        ],
        "properties": {
          "system": {
            "type": "string"
          },
          "voice": {
            "type": "string",
            "nullable": true
          },
          "character": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PersonaBootstrapAuth": {
        "type": "object",
        "description": "What the presented token is. A `visitor` token is the anonymous, read-shaped class.",
        "required": [
          "tokenClass",
          "subject",
          "expiresAt",
          "scope"
        ],
        "properties": {
          "tokenClass": {
            "type": "string",
            "enum": [
              "persona",
              "visitor"
            ]
          },
          "subject": {
            "$ref": "#/components/schemas/PersonaBootstrapSubject"
          },
          "expiresAt": {
            "type": "string",
            "nullable": true
          },
          "scope": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PersonaBootstrapSubject": {
        "type": "object",
        "required": [
          "kind",
          "id"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "PersonaBootstrapBucket": {
        "type": "object",
        "description": "A bucket the token can at least read. Unreadable buckets are omitted, not listed as denied.",
        "required": [
          "id",
          "name",
          "kind",
          "scope",
          "access"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "global"
            ]
          },
          "access": {
            "$ref": "#/components/schemas/PersonaBootstrapBucketAccess"
          }
        }
      },
      "PersonaBootstrapBucketAccess": {
        "type": "object",
        "description": "A visitor token reports create/update/delete false whatever the underlying grant says.",
        "required": [
          "read",
          "create",
          "update",
          "delete"
        ],
        "properties": {
          "read": {
            "type": "boolean"
          },
          "create": {
            "type": "boolean"
          },
          "update": {
            "type": "boolean"
          },
          "delete": {
            "type": "boolean"
          }
        }
      },
      "PersonaBootstrapMemory": {
        "type": "object",
        "description": "Both false for a visitor token.",
        "required": [
          "read",
          "write"
        ],
        "properties": {
          "read": {
            "type": "boolean"
          },
          "write": {
            "type": "boolean"
          }
        }
      },
      "PersonaBootstrapTool": {
        "type": "object",
        "required": [
          "name",
          "displayName",
          "readOnly",
          "autonomous"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "readOnly": {
            "type": "boolean"
          },
          "autonomous": {
            "type": "boolean",
            "description": "May be called without a human in the loop"
          }
        }
      },
      "PersonaBootstrapChat": {
        "type": "object",
        "required": [
          "conversationsUrl",
          "streaming",
          "limits"
        ],
        "properties": {
          "conversationsUrl": {
            "type": "string",
            "description": "Where to open conversations — the public visitor surface or the authenticated one"
          },
          "streaming": {
            "type": "string",
            "enum": [
              "sse"
            ]
          },
          "limits": {
            "$ref": "#/components/schemas/PersonaBootstrapChatLimits"
          }
        }
      },
      "PersonaBootstrapChatLimits": {
        "type": "object",
        "required": [
          "maxConversationLength",
          "maxMessageChars"
        ],
        "properties": {
          "maxConversationLength": {
            "type": "integer"
          },
          "maxMessageChars": {
            "type": "integer"
          }
        }
      },
      "SearchDiscussionTopicResult": {
        "type": "object",
        "required": [
          "id",
          "title",
          "replyCount",
          "lastActivityAt",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "categoryId": {
            "type": "string",
            "nullable": true
          },
          "replyCount": {
            "type": "integer"
          },
          "lastActivityAt": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "SearchDiscussionPostResult": {
        "type": "object",
        "required": [
          "id",
          "topicId",
          "postNumber",
          "createdAt",
          "rank"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "topicId": {
            "type": "string"
          },
          "postNumber": {
            "type": "integer"
          },
          "bodyDocumentId": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "rank": {
            "type": "number",
            "description": "ts_rank relevance score"
          }
        }
      },
      "SearchDocumentResult": {
        "type": "object",
        "required": [
          "blockId",
          "documentId",
          "blockType",
          "position",
          "snippet",
          "rank"
        ],
        "properties": {
          "blockId": {
            "type": "string"
          },
          "documentId": {
            "type": "string"
          },
          "blockType": {
            "type": "string"
          },
          "position": {
            "type": "string"
          },
          "snippet": {
            "type": "string",
            "description": "Plain-text excerpt (ts_headline, no markup)"
          },
          "rank": {
            "type": "number",
            "description": "ts_rank relevance score"
          }
        }
      },
      "SearchNoteResult": {
        "type": "object",
        "required": [
          "id",
          "title",
          "content",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "ShiprPersona": {
        "type": "object",
        "description": "A persona that may be put on a repository's crew. THREE FIELDS: the crew names an actor, it does not copy one — everything else about a persona is read where personas are read.",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ShiprGroup": {
        "type": "object",
        "description": "A folder in the deployment tree. `path` and `depth` are trigger-maintained.",
        "properties": {
          "id": {
            "type": "string"
          },
          "parentId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "depth": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          }
        }
      },
      "ShiprRepo": {
        "type": "object",
        "description": "One deployment repository — a mirror. A dev repo with several `[deployments]` shards has one of these per shard.",
        "properties": {
          "id": {
            "type": "string"
          },
          "devRepoId": {
            "type": "string"
          },
          "groupId": {
            "type": "string",
            "nullable": true
          },
          "slug": {
            "type": "string",
            "description": "owner/name on the forge."
          },
          "shard": {
            "type": "string"
          },
          "shipBranch": {
            "type": "string"
          },
          "envBranches": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "environment → branch. An environment absent here is one this repository does not deploy to, and its ladder column is not drawn."
          },
          "registeredAt": {
            "type": "string",
            "nullable": true
          },
          "provisioned": {
            "type": "object",
            "nullable": true
          },
          "position": {
            "type": "integer"
          }
        }
      },
      "ShiprDevRepo": {
        "type": "object",
        "description": "The source repository a mirror is fed from.",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string",
            "nullable": true,
            "description": "What the operator calls it, which is not always what the forge calls it. Null means no opinion and every reader falls back to `slug`. A LABEL AND NOTHING MORE: no branch, no path and no forge call is derived from it."
          },
          "mainBranch": {
            "type": "string"
          },
          "preparedBranch": {
            "type": "string"
          },
          "declarationSha": {
            "type": "string",
            "nullable": true
          },
          "connectionId": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "ShiprOrgDefaults": {
        "type": "object",
        "description": "What a mirror in one forge org is BORN with — never a description of one that already exists. Read when a mirror is first written; changing it re-aims the next repository and moves nothing already registered.",
        "properties": {
          "id": {
            "type": "string"
          },
          "org": {
            "type": "string",
            "description": "The forge account login."
          },
          "deploymentOwner": {
            "type": "string",
            "nullable": true,
            "description": "Which org the deployment repositories go in. Null is “the same org”, stored as null rather than as a copy so that an operator who never chose stays distinguishable from one who chose the org they were already in."
          },
          "nameSuffix": {
            "type": "string",
            "description": "`-deployment`, spelled per-org. Appended to the source repository’s name when its `.shipr` declares no shards."
          },
          "envBranches": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "The ladder a new mirror starts with. Empty means the built-in default (every environment, named after itself), not a repository that deploys nowhere."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "ShiprLadder": {
        "type": "object",
        "description": "The column-aligned commit view: one row per commit, oldest first, with a mark in each branch column whose tip is at or above it.",
        "properties": {
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sha": {
                  "type": "string"
                },
                "when": {
                  "type": "string"
                },
                "subject": {
                  "type": "string"
                },
                "marks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "settled": {
                  "type": "boolean"
                }
              }
            }
          },
          "settled": {
            "type": "boolean",
            "description": "Every live branch is on the newest commit — nothing is in flight."
          },
          "tips": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "readAt": {
            "type": "string",
            "description": "When the last status run read this."
          }
        }
      },
      "ShiprRun": {
        "type": "object",
        "description": "One queued or completed operation over a scope.",
        "properties": {
          "id": {
            "type": "string"
          },
          "operation": {
            "type": "string",
            "enum": [
              "status",
              "prepare",
              "deploy",
              "register",
              "unregister"
            ]
          },
          "scopeKind": {
            "type": "string",
            "enum": [
              "deploy_repo",
              "dev_repo",
              "group",
              "all"
            ]
          },
          "scopeId": {
            "type": "string",
            "nullable": true
          },
          "environments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "summary": {
            "type": "object",
            "nullable": true
          },
          "startedAt": {
            "type": "string",
            "nullable": true
          },
          "finishedAt": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "ShiprRunStep": {
        "type": "object",
        "description": "One repository within a run — and, for a deploy, one stage of it. A failed step does not fail the run.",
        "properties": {
          "id": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "deployRepoId": {
            "type": "string",
            "nullable": true
          },
          "ordinal": {
            "type": "integer"
          },
          "environment": {
            "type": "string",
            "nullable": true
          },
          "stage": {
            "type": "string",
            "enum": [
              "advance",
              "arrival",
              "verify"
            ],
            "nullable": true
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "succeeded",
              "failed",
              "skipped"
            ]
          },
          "detail": {
            "type": "object",
            "nullable": true
          }
        }
      },
      "ShiprRunEvent": {
        "type": "object",
        "description": "One line of a run’s log. `seq` is per-run and monotone — use it as a cursor.",
        "properties": {
          "seq": {
            "type": "integer"
          },
          "stepId": {
            "type": "string",
            "nullable": true
          },
          "stream": {
            "type": "string",
            "enum": [
              "out",
              "err",
              "meta"
            ]
          },
          "text": {
            "type": "string"
          },
          "at": {
            "type": "string"
          }
        }
      },
      "FeedItem": {
        "type": "object",
        "required": [
          "id",
          "customerId",
          "ecosystemId",
          "source",
          "entityType",
          "action",
          "summary",
          "isRead",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          },
          "ecosystemId": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "entityType": {
            "type": "string"
          },
          "entityId": {
            "type": "string",
            "nullable": true
          },
          "action": {
            "type": "string"
          },
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "summary": {
            "type": "string"
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "isRead": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "FeedPage": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeedItem"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          }
        }
      },
      "FeedUnreadCount": {
        "type": "object",
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer"
          }
        }
      },
      "FeedReadAllResult": {
        "type": "object",
        "required": [
          "updated"
        ],
        "properties": {
          "updated": {
            "type": "integer"
          }
        }
      },
      "FeatureFlag": {
        "type": "object",
        "required": [
          "id",
          "key",
          "description",
          "enabled",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "key": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "ServerBag": {
        "type": "object",
        "required": [
          "key",
          "value",
          "description",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "description": "Arbitrary JSON value"
          },
          "description": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "AccessAuditEntry": {
        "type": "object",
        "required": [
          "id",
          "ownerKind",
          "ownerId",
          "actorKind",
          "actorId",
          "actorEmail",
          "action",
          "subjectKind",
          "subjectId",
          "targetFeature",
          "targetItemId",
          "roleId",
          "before",
          "after",
          "at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ownerKind": {
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "actorKind": {
            "type": "string"
          },
          "actorId": {
            "type": "string"
          },
          "actorEmail": {
            "type": "string",
            "nullable": true
          },
          "action": {
            "type": "string"
          },
          "subjectKind": {
            "type": "string",
            "nullable": true
          },
          "subjectId": {
            "type": "string",
            "nullable": true
          },
          "targetFeature": {
            "type": "string",
            "nullable": true
          },
          "targetItemId": {
            "type": "string",
            "nullable": true
          },
          "roleId": {
            "type": "string",
            "nullable": true
          },
          "before": {
            "nullable": true,
            "description": "Pre-change state (action-shaped)"
          },
          "after": {
            "nullable": true,
            "description": "Post-change state (action-shaped)"
          },
          "at": {
            "type": "string"
          }
        }
      },
      "AccessAuditPage": {
        "type": "object",
        "required": [
          "items",
          "page",
          "pageSize",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessAuditEntry"
            }
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer",
            "description": "Clamped 1..200"
          },
          "total": {
            "type": "integer",
            "description": "Saturates at a 10,000-row count cap"
          }
        }
      },
      "ReservedIdentifier": {
        "type": "object",
        "required": [
          "rdid",
          "entityType",
          "entityId",
          "reason",
          "heldSince",
          "releasable",
          "needsName"
        ],
        "properties": {
          "rdid": {
            "type": "string"
          },
          "entityType": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "rename-leftover",
              "orphan",
              "deleted-entity"
            ],
            "description": "What is holding the name. An in-window rename alias and an orphaned mapping are deleted outright. A deleted entity is freed the same way when its own table has already let the name go; while that table is still holding it, the release renames that row instead and `needsName` is true."
          },
          "heldSince": {
            "type": "string",
            "nullable": true,
            "description": "When the name got stuck: an alias's supersede instant, else the row's last write"
          },
          "releasable": {
            "type": "boolean",
            "description": "False for names this surface can only report: a revoked token slug (reserved by policy) and legacy reverse-domain handles with no parent chain. Releasing a non-releasable row answers 403."
          },
          "needsName": {
            "type": "boolean",
            "description": "Releasing this one needs a name from you. The deleted row is still sitting on the slug in its own table, so freeing it is a rename, and this service does not invent names — send it as `newNames[rdid]` on the release."
          }
        }
      },
      "ReservedIdentifierPage": {
        "type": "object",
        "required": [
          "items",
          "page",
          "pageSize",
          "total",
          "truncated"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReservedIdentifier"
            }
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer",
            "description": "Clamped 1..200"
          },
          "total": {
            "type": "integer",
            "description": "Saturates at a 2,000-row cap: the list merges heterogeneous sources and cannot be paged by a single SQL OFFSET"
          },
          "truncated": {
            "type": "boolean",
            "description": "A held name is missing from this response — a source scan came back at its cap, or the merge overflowed the overall one. Clients that filter client-side MUST surface this: past the cap an empty result is not evidence that a name is free."
          }
        }
      },
      "ReleasedName": {
        "type": "object",
        "required": [
          "rdid",
          "reason",
          "freed",
          "aliasesRemoved",
          "stillHeldBy",
          "renamedTo"
        ],
        "properties": {
          "rdid": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "rename-leftover",
              "orphan",
              "deleted-entity"
            ]
          },
          "freed": {
            "type": "boolean",
            "description": "The released NAME is available again. Deliberately not \"the surrounding namespace is empty\" — a different type sharing that path is a different name."
          },
          "aliasesRemoved": {
            "type": "integer"
          },
          "stillHeldBy": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Canonical addresses still sitting in that space, informational. Read as \"these exist nearby\", never as \"the release failed\"."
          },
          "renamedTo": {
            "type": "string",
            "nullable": true,
            "description": "The name the dead row was renamed to — your own `newNames` entry, echoed back. Null on every other branch, where nothing outside the identifier table was written."
          }
        }
      },
      "ReleaseResult": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ReleasedName"
          },
          {
            "type": "object",
            "required": [
              "children"
            ],
            "properties": {
              "children": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ReleasedName"
                }
              }
            }
          }
        ]
      },
      "AdminNote": {
        "type": "object",
        "description": "An operator note attached to some other row. Never visible to that row’s subject.",
        "required": [
          "id",
          "ecosystemId",
          "subjectTable",
          "subjectId",
          "content",
          "createdBy",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36
          },
          "ecosystemId": {
            "type": "string",
            "maxLength": 36
          },
          "subjectTable": {
            "type": "string",
            "maxLength": 120
          },
          "subjectId": {
            "type": "string",
            "maxLength": 36
          },
          "content": {
            "type": "string"
          },
          "createdBy": {
            "type": "string",
            "maxLength": 36
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "AdminNotesReconcileBody": {
        "type": "object",
        "required": [
          "subjectTable",
          "subjectId",
          "notes"
        ],
        "properties": {
          "subjectTable": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "subjectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 36
          },
          "notes": {
            "type": "array",
            "description": "The complete set for this subject. Anything absent is deleted.",
            "items": {
              "$ref": "#/components/schemas/AdminNoteInput"
            }
          }
        }
      },
      "AdminNoteInput": {
        "type": "object",
        "required": [
          "content"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "description": "Omit to create; supply to update in place"
          },
          "content": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "EntityHistoryEntry": {
        "type": "object",
        "description": "One thing that happened to a row. Append-only; nothing here is editable.",
        "required": [
          "id",
          "ecosystemId",
          "subjectTable",
          "subjectId",
          "actorId",
          "actorLabel",
          "action",
          "detail",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36
          },
          "ecosystemId": {
            "type": "string",
            "maxLength": 36
          },
          "subjectTable": {
            "type": "string",
            "maxLength": 120
          },
          "subjectId": {
            "type": "string",
            "maxLength": 36
          },
          "actorId": {
            "type": "string",
            "maxLength": 36,
            "nullable": true
          },
          "actorLabel": {
            "type": "string",
            "maxLength": 120,
            "nullable": true
          },
          "action": {
            "type": "string",
            "maxLength": 60,
            "description": "Free text, not an enum — each subsystem names its own. Emitted today: request_received, invite_sent, note_added, status_changed, accepted, notes_updated."
          },
          "detail": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true,
            "description": "Action-specific payload; the shape is whatever emitted the entry."
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "TeamMember": {
        "type": "object",
        "required": [
          "id",
          "teamId",
          "memberKind",
          "userId",
          "role",
          "addedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "teamId": {
            "type": "string"
          },
          "memberKind": {
            "type": "string",
            "enum": [
              "customer",
              "persona"
            ],
            "description": "which principal userId names — 'customer' (customer.customers) or 'persona' (persona.personas). Present on every response: GET list rows, the add-persona 201, and the by-email add 201 (always a customer)."
          },
          "userId": {
            "type": "string",
            "description": "the member principal id — a customer id, or a persona id when memberKind is 'persona'"
          },
          "role": {
            "type": "string"
          },
          "addedAt": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "nullable": true,
            "description": "the member's email (resolved; null for a persona member or a foreign customer)"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "personaSlug": {
            "type": "string",
            "nullable": true,
            "description": "the persona's slug when memberKind is 'persona' (null for a customer member)"
          },
          "personaName": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TeamMemberList": {
        "type": "object",
        "required": [
          "members"
        ],
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamMember"
            }
          }
        }
      },
      "TeamMemberCounts": {
        "type": "object",
        "required": [
          "counts"
        ],
        "properties": {
          "counts": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "teamId",
                "count"
              ],
              "properties": {
                "teamId": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "AccessFeature": {
        "type": "object",
        "required": [
          "key",
          "label"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "the feature-area key grants are recorded against, e.g. 'audiences'"
          },
          "label": {
            "type": "string",
            "description": "the display name for this area (the roles editor labels its row with it)"
          }
        }
      },
      "AccessFeatureList": {
        "type": "object",
        "required": [
          "features"
        ],
        "properties": {
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessFeature"
            }
          }
        }
      },
      "AccessGrant": {
        "type": "object",
        "required": [
          "feature",
          "itemVerbs",
          "subitemVerbs"
        ],
        "properties": {
          "feature": {
            "type": "string",
            "description": "a feature-area key, e.g. 'projects' | 'personas'"
          },
          "itemVerbs": {
            "type": "string",
            "description": "top-level item verbs, comma-letter subset of 'C,R,U,D,M' (M = manage access)"
          },
          "subitemVerbs": {
            "type": "string",
            "description": "sub-item verbs, subset of 'C,R,U,D'"
          }
        }
      },
      "AccessRole": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "isSystem",
          "defaultFor",
          "grants"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "isSystem": {
            "type": "boolean"
          },
          "defaultFor": {
            "type": "string",
            "enum": [
              "",
              "customer",
              "persona"
            ],
            "description": "which member kind holds this role implicitly as the workspace default"
          },
          "grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessGrant"
            }
          }
        }
      },
      "AccessRoleList": {
        "type": "object",
        "required": [
          "roles"
        ],
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessRole"
            }
          }
        }
      },
      "AccessRoleEnvelope": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "$ref": "#/components/schemas/AccessRole"
          }
        }
      },
      "AccessAssignment": {
        "type": "object",
        "required": [
          "id",
          "subjectKind",
          "subjectId",
          "scopeFeature",
          "scopeItemId",
          "roleId"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "subjectKind": {
            "type": "string",
            "enum": [
              "customer",
              "persona",
              "team"
            ]
          },
          "subjectId": {
            "type": "string"
          },
          "scopeFeature": {
            "type": "string",
            "description": "'' = workspace-wide"
          },
          "scopeItemId": {
            "type": "string",
            "description": "'' = workspace-wide"
          },
          "roleId": {
            "type": "string"
          },
          "roleSlug": {
            "type": "string"
          },
          "roleName": {
            "type": "string"
          },
          "grantedBy": {
            "type": "string",
            "nullable": true
          },
          "grantedAt": {
            "type": "string"
          }
        }
      },
      "AccessAssignmentList": {
        "type": "object",
        "required": [
          "assignments"
        ],
        "properties": {
          "assignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessAssignment"
            }
          },
          "restricted": {
            "type": "boolean",
            "description": "present on item-scoped listings: whether the item is RESTRICTED"
          }
        }
      },
      "AccessAssignmentEnvelope": {
        "type": "object",
        "required": [
          "assignment"
        ],
        "properties": {
          "assignment": {
            "$ref": "#/components/schemas/AccessAssignment"
          }
        }
      },
      "AccessRestriction": {
        "type": "object",
        "required": [
          "restricted"
        ],
        "properties": {
          "restricted": {
            "type": "boolean"
          }
        }
      },
      "AccessEffective": {
        "type": "object",
        "required": [
          "itemVerbs",
          "subitemVerbs",
          "restricted",
          "decidedBy"
        ],
        "properties": {
          "itemVerbs": {
            "type": "string"
          },
          "subitemVerbs": {
            "type": "string"
          },
          "restricted": {
            "type": "boolean"
          },
          "decidedBy": {
            "type": "object",
            "additionalProperties": true,
            "description": "per-verb provenance (the explainer): verb → {kind: 'owner'|'admin-role'|'grant', roleSlug?, via?, scopeItemId?}; sub-item verbs keyed 'sub:<verb>'"
          }
        }
      },
      "TeamReachGrant": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "teamId",
          "permission",
          "grantedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string",
            "description": "the canonical uuid of the ecosystem reached INTO (never the rdid form)"
          },
          "teamId": {
            "type": "string"
          },
          "permission": {
            "type": "string",
            "description": "free-form permission key (max 100 chars)"
          },
          "grantedBy": {
            "type": "string",
            "nullable": true,
            "description": "the user who granted it; null for rows seeded outside this route"
          },
          "grantedAt": {
            "type": "string"
          },
          "teamName": {
            "type": "string",
            "nullable": true
          },
          "teamSlug": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TeamReachGrantList": {
        "type": "object",
        "required": [
          "grants"
        ],
        "properties": {
          "grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamReachGrant"
            }
          }
        }
      },
      "StorageAttachment": {
        "type": "object",
        "required": [
          "id",
          "ecosystemId",
          "customerId",
          "ownerKind",
          "ownerId",
          "parentType",
          "objectKey",
          "storageKind",
          "filename",
          "contentType",
          "sizeBytes",
          "contentHash",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "The owning customer, empty when the owner is not a customer. Superseded by ownerKind / ownerId, and kept on the wire for clients that have not moved."
          },
          "ownerKind": {
            "type": "string",
            "description": "Kind of principal that owns the attachment: 'customer', 'organization', 'application', 'persona' or 'ecosystem'."
          },
          "ownerId": {
            "type": "string",
            "description": "Id of the owning principal."
          },
          "parentType": {
            "type": "string",
            "description": "Kind of row the attachment hangs off, e.g. 'standalone', 'persona', 'registry.entry'."
          },
          "parentId": {
            "type": "string",
            "nullable": true,
            "description": "Id of the row the attachment hangs off; null for a standalone attachment."
          },
          "objectKey": {
            "type": "string",
            "description": "R2 object key the presigned URLs address."
          },
          "storageKind": {
            "type": "string",
            "description": "Backing store, e.g. 'r2'."
          },
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer"
          },
          "contentHash": {
            "type": "string"
          },
          "width": {
            "type": "integer",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "nullable": true
          },
          "durationMs": {
            "type": "integer",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "ready"
            ],
            "description": "'pending' (presigned, awaiting upload) → 'ready' (bytes confirmed)."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true,
            "description": "Caller-supplied JSON metadata (jsonb) — intentionally open."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "StoragePresignedUpload": {
        "type": "object",
        "required": [
          "attachment",
          "uploadUrl"
        ],
        "properties": {
          "attachment": {
            "$ref": "#/components/schemas/StorageAttachment"
          },
          "uploadUrl": {
            "type": "string",
            "format": "uri",
            "description": "Presigned PUT URL — upload the bytes directly to R2."
          }
        }
      },
      "StorageDeduplicated": {
        "type": "object",
        "required": [
          "attachment",
          "deduplicated"
        ],
        "properties": {
          "attachment": {
            "$ref": "#/components/schemas/StorageAttachment"
          },
          "deduplicated": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        }
      },
      "StorageQuotaExceeded": {
        "type": "object",
        "required": [
          "error",
          "used",
          "quota",
          "requested"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Error"
          },
          "used": {
            "type": "integer",
            "description": "Bytes currently used by ready attachments."
          },
          "quota": {
            "type": "integer",
            "description": "The caller’s total quota in bytes."
          },
          "requested": {
            "type": "integer",
            "description": "Declared size of the rejected upload."
          }
        }
      },
      "StorageAttachmentEnvelope": {
        "type": "object",
        "required": [
          "attachment"
        ],
        "properties": {
          "attachment": {
            "$ref": "#/components/schemas/StorageAttachment"
          }
        }
      },
      "StorageDownload": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Presigned GET URL — download the bytes directly from R2."
          }
        }
      },
      "SyncManifestEntry": {
        "type": "object",
        "required": [
          "resource",
          "schemaVersion"
        ],
        "properties": {
          "resource": {
            "type": "string"
          },
          "schemaVersion": {
            "type": "integer"
          }
        }
      },
      "SyncChange": {
        "type": "object",
        "required": [
          "resource",
          "id",
          "op",
          "syncVersion"
        ],
        "properties": {
          "resource": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "op": {
            "type": "string",
            "enum": [
              "upsert",
              "delete"
            ]
          },
          "syncVersion": {
            "type": "string",
            "description": "Server-assigned monotonic version (bigint as string)"
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "Row for upserts, minus server-internal sync columns and derived columns such as a memory's vector; absent for deletes"
          }
        }
      },
      "SyncPullResponse": {
        "type": "object",
        "required": [
          "manifest",
          "changes",
          "cursor",
          "hasMore"
        ],
        "properties": {
          "manifest": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncManifestEntry"
            }
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncChange"
            }
          },
          "cursor": {
            "type": "string",
            "description": "Opaque; echo back on the next pull"
          },
          "hasMore": {
            "type": "boolean"
          }
        }
      },
      "SyncPushOp": {
        "type": "object",
        "required": [
          "opId",
          "resource",
          "rowId",
          "type"
        ],
        "properties": {
          "opId": {
            "type": "string",
            "format": "uuid",
            "description": "Client-generated UUIDv7 idempotency key"
          },
          "resource": {
            "type": "string"
          },
          "rowId": {
            "type": "string",
            "format": "uuid",
            "description": "Client-generated row id (offline creation)"
          },
          "type": {
            "type": "string",
            "enum": [
              "upsert",
              "delete"
            ]
          },
          "baseVersion": {
            "type": "string",
            "description": "sync_version the client last saw; stale → conflict"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "SyncPushRequest": {
        "type": "object",
        "required": [
          "deviceId",
          "ops"
        ],
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "ops": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncPushOp"
            },
            "minItems": 1,
            "maxItems": 500
          }
        }
      },
      "SyncPushResult": {
        "type": "object",
        "required": [
          "opId",
          "status"
        ],
        "properties": {
          "opId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "applied",
              "conflict",
              "rejected"
            ]
          },
          "reason": {
            "type": "string"
          },
          "current": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "newVersion": {
            "type": "string",
            "description": "Post-apply sync_version; present only on `applied` results that wrote a row (absent for an idempotent no-op delete). Clients SHOULD adopt it as the row's new baseVersion for subsequent staged edits."
          }
        }
      },
      "SyncPushResponse": {
        "type": "object",
        "required": [
          "results",
          "watermark"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncPushResult"
            }
          },
          "watermark": {
            "type": "string"
          }
        }
      },
      "SyncEnrollmentRow": {
        "type": "object",
        "description": "One resource from the sync catalog as it stands for a given ecosystem: what the code ships as the default, and whether an operator has overridden it.",
        "required": [
          "resource",
          "scope",
          "pushMode",
          "defaultEnabled",
          "enabled",
          "overridden"
        ],
        "properties": {
          "resource": {
            "type": "string",
            "description": "\"<schema>.<table>\", e.g. content.contacts"
          },
          "scope": {
            "type": "string",
            "enum": [
              "owner",
              "customer",
              "ecosystem"
            ],
            "description": "Which rows a caller syncs: 'owner' the rows whose owner pair names them, 'customer' the rows whose customer_id does, 'ecosystem' every row in their ecosystem"
          },
          "pushMode": {
            "type": "string",
            "enum": [
              "generic",
              "route"
            ],
            "description": "'route' means /sync/push refuses direct writes; the row's own route owns them"
          },
          "defaultEnabled": {
            "type": "boolean",
            "description": "What the shipped catalog says"
          },
          "enabled": {
            "type": "boolean",
            "description": "What is actually in force — the override if there is one"
          },
          "overridden": {
            "type": "boolean"
          }
        }
      },
      "SyncEnrollmentList": {
        "type": "object",
        "required": [
          "tables"
        ],
        "properties": {
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncEnrollmentRow"
            }
          }
        }
      },
      "SyncEnrollmentUpdate": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "Theme": {
        "type": "object",
        "required": [
          "key",
          "label",
          "basedOn",
          "data",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "basedOn": {
            "type": "string",
            "nullable": true
          },
          "data": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "UsageStorageQuota": {
        "type": "object",
        "required": [
          "quotaBytes",
          "usageBytes",
          "availableBytes"
        ],
        "properties": {
          "quotaBytes": {
            "type": "integer",
            "description": "Per-user quota in bytes (override or 5 GB default)"
          },
          "usageBytes": {
            "type": "integer",
            "description": "Live sum of ready, non-deleted attachment bytes"
          },
          "availableBytes": {
            "type": "integer",
            "description": "max(0, quotaBytes - usageBytes)"
          }
        }
      },
      "UsageStorageQuotaRow": {
        "type": "object",
        "required": [
          "userId",
          "ecosystemId",
          "quotaBytes",
          "updatedAt"
        ],
        "properties": {
          "userId": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string",
            "description": "Ecosystem id the override is scoped to"
          },
          "quotaBytes": {
            "type": "integer"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "UsageLimits": {
        "type": "object",
        "required": [
          "quotaRequests",
          "quotaBytes",
          "quotaTokens",
          "quotaCostMicros",
          "enforced"
        ],
        "properties": {
          "quotaRequests": {
            "type": "integer",
            "nullable": true,
            "description": "Calls per period; null = uncapped"
          },
          "quotaBytes": {
            "type": "integer",
            "nullable": true,
            "description": "HTTP bytes per period; null = uncapped"
          },
          "quotaTokens": {
            "type": "integer",
            "nullable": true,
            "description": "LLM tokens per period; null = uncapped"
          },
          "quotaCostMicros": {
            "type": "integer",
            "nullable": true,
            "description": "Provider spend in µUSD per period; null = uncapped"
          },
          "enforced": {
            "type": "boolean",
            "description": "Whether exceeding these limits refuses a request"
          }
        }
      },
      "UsageSummaryRow": {
        "type": "object",
        "required": [
          "kind",
          "scope",
          "principalId",
          "label",
          "periodStart",
          "periodDays",
          "tier",
          "limits",
          "requests",
          "bytes",
          "tokens",
          "costMicros"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "self",
              "member",
              "token",
              "persona",
              "application",
              "ecosystem"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "user",
              "persona",
              "token",
              "application",
              "visitor",
              "ecosystem",
              "visitor_global"
            ]
          },
          "principalId": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "description": "Display name (user, token or persona name)"
          },
          "periodStart": {
            "type": "string",
            "description": "ISO date the current accounting window opened"
          },
          "periodDays": {
            "type": "integer",
            "description": "Window length in days"
          },
          "tier": {
            "type": "string",
            "description": "Slug of the rate-limit tier governing this principal"
          },
          "limits": {
            "$ref": "#/components/schemas/UsageLimits"
          },
          "requests": {
            "type": "integer"
          },
          "bytes": {
            "type": "integer",
            "description": "HTTP request + response bytes"
          },
          "tokens": {
            "type": "integer",
            "description": "LLM input + output tokens"
          },
          "costMicros": {
            "type": "integer",
            "description": "Provider spend in integer micro-dollars (µUSD)"
          }
        }
      },
      "UsageSummary": {
        "type": "object",
        "required": [
          "rows"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageSummaryRow"
            }
          }
        }
      },
      "UsageEnforcement": {
        "type": "object",
        "required": [
          "enabled",
          "source",
          "envOverride",
          "flag",
          "unknownPricePolicy",
          "unknownPriceInputMicrosPerMToken",
          "unknownPriceOutputMicrosPerMToken",
          "turnTokenReserve",
          "eventRetentionDays",
          "visitorGlobalDailyTokenBudget",
          "visitorGlobalDailyCostMicros",
          "visitorTurnTokenReserve"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Effective switch: false ⇒ every tier's quota_enforced is inert (observe only)"
          },
          "source": {
            "type": "string",
            "enum": [
              "environment",
              "flag"
            ],
            "description": "Which input decided `enabled` — the env override, or the feature-flag row"
          },
          "envOverride": {
            "type": "boolean",
            "nullable": true,
            "description": "USAGE_ENFORCEMENT_ENABLED; null (the normal case) means the flag row decides"
          },
          "flag": {
            "type": "object",
            "nullable": true,
            "required": [
              "id",
              "enabled"
            ],
            "description": "The system.feature_flags 'usage_enforcement' row; null ⇒ never created",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Serial to address the row at /system/feature-flags/{id}"
              },
              "enabled": {
                "type": "boolean"
              }
            }
          },
          "unknownPricePolicy": {
            "type": "string",
            "enum": [
              "ceiling",
              "refuse",
              "free"
            ],
            "description": "What an unpriced model is charged (USAGE_UNKNOWN_PRICE_POLICY)"
          },
          "unknownPriceInputMicrosPerMToken": {
            "type": "integer",
            "description": "Ceiling-policy input rate in µUSD per million tokens"
          },
          "unknownPriceOutputMicrosPerMToken": {
            "type": "integer",
            "description": "Ceiling-policy output rate in µUSD per million tokens"
          },
          "turnTokenReserve": {
            "type": "integer",
            "description": "Tokens a signed-in chat turn claims up front (USAGE_TURN_TOKEN_RESERVE)"
          },
          "eventRetentionDays": {
            "type": "integer",
            "description": "Age past which a usage_events row is swept (counters are kept forever)"
          },
          "visitorGlobalDailyTokenBudget": {
            "type": "integer",
            "nullable": true,
            "description": "Anonymous LLM tokens per day per OWNING ECOSYSTEM (VISITOR_GLOBAL_DAILY_TOKEN_BUDGET); refuses regardless of `enabled`. null ⇒ lifted (`off`)"
          },
          "visitorGlobalDailyCostMicros": {
            "type": "integer",
            "nullable": true,
            "description": "The same daily budget in µUSD of provider spend (VISITOR_GLOBAL_DAILY_COST_MICROS); refuses regardless of `enabled`. null ⇒ lifted (`off`)"
          },
          "visitorTurnTokenReserve": {
            "type": "integer",
            "description": "Tokens an anonymous turn claims up front (VISITOR_TURN_TOKEN_RESERVE); against the cost budget the same claim is priced at the output rate"
          }
        }
      },
      "UsageCostRow": {
        "type": "object",
        "required": [
          "costMicros",
          "unpricedLines",
          "lines",
          "quantities"
        ],
        "properties": {
          "day": {
            "type": "string",
            "format": "date",
            "description": "groupBy=day only"
          },
          "ecosystemKey": {
            "type": "string",
            "format": "uuid",
            "description": "groupBy=key only. The nil uuid is platform-level spend"
          },
          "category": {
            "type": "string",
            "enum": [
              "llm",
              "embedding",
              "email",
              "sms",
              "storage_op",
              "outbound_http",
              "realtime"
            ],
            "description": "groupBy=key only"
          },
          "provider": {
            "type": "string",
            "description": "groupBy=key only"
          },
          "sku": {
            "type": "string",
            "description": "groupBy=key only"
          },
          "paidBy": {
            "type": "string",
            "enum": [
              "platform",
              "customer_key"
            ],
            "description": "groupBy=key only"
          },
          "costMicros": {
            "type": "integer",
            "description": "Summed cost in µUSD (unpriced lines add 0)"
          },
          "unpricedLines": {
            "type": "integer",
            "description": "Lines with no price; > 0 ⇒ a floor"
          },
          "lines": {
            "type": "integer",
            "description": "Cost lines summed into this row"
          },
          "quantities": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "description": "Key-wise sums of the quantities (requests, input_tokens, minutes, …)"
          }
        }
      },
      "UsageCostReport": {
        "type": "object",
        "required": [
          "from",
          "to",
          "groupBy",
          "rows"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date",
            "description": "Inclusive"
          },
          "groupBy": {
            "type": "string",
            "enum": [
              "day",
              "key"
            ]
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageCostRow"
            }
          }
        }
      },
      "UsageCallEvent": {
        "type": "object",
        "required": [
          "id",
          "scope",
          "principalId",
          "route",
          "method",
          "status",
          "occurredAt",
          "kind"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "scope": {
            "type": "string"
          },
          "principalId": {
            "type": "string"
          },
          "ecosystemId": {
            "type": "string",
            "nullable": true
          },
          "route": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "requestBytes": {
            "type": "integer"
          },
          "responseBytes": {
            "type": "integer"
          },
          "occurredAt": {
            "type": "string"
          },
          "callId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "parentCallId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "kind": {
            "type": "string"
          },
          "routePattern": {
            "type": "string",
            "nullable": true
          },
          "durationMs": {
            "type": "integer",
            "nullable": true
          },
          "dbMs": {
            "type": "integer",
            "nullable": true
          },
          "dbQueries": {
            "type": "integer",
            "nullable": true
          },
          "streamEvents": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "UsageCostLine": {
        "type": "object",
        "required": [
          "id",
          "callId",
          "occurredAt",
          "category",
          "provider",
          "sku",
          "quantities",
          "costMicros",
          "paidBy",
          "partial",
          "attempt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "callId": {
            "type": "string",
            "format": "uuid"
          },
          "ecosystemId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "llm",
              "embedding",
              "email",
              "sms",
              "storage_op",
              "outbound_http",
              "realtime"
            ]
          },
          "provider": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "quantities": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "description": "Key-wise sums of the quantities (requests, input_tokens, minutes, …)"
          },
          "unitPrices": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "number"
            },
            "description": "The per-unit prices the cost was computed from, snapshotted"
          },
          "costMicros": {
            "type": "integer",
            "nullable": true,
            "description": "µUSD; null ⇒ unpriced"
          },
          "paidBy": {
            "type": "string",
            "enum": [
              "platform",
              "customer_key"
            ]
          },
          "partial": {
            "type": "boolean",
            "description": "The provider call did not complete; a floor"
          },
          "attempt": {
            "type": "integer"
          }
        }
      },
      "UsageCallLedger": {
        "type": "object",
        "required": [
          "callId",
          "events",
          "lines"
        ],
        "properties": {
          "callId": {
            "type": "string",
            "format": "uuid"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageCallEvent"
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageCostLine"
            }
          }
        }
      },
      "UsageCallReport": {
        "allOf": [
          {
            "$ref": "#/components/schemas/UsageCallLedger"
          },
          {
            "type": "object",
            "required": [
              "children"
            ],
            "properties": {
              "children": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UsageCallLedger"
                },
                "description": "Calls this one started (parent_call_id), one level deep"
              }
            }
          }
        ]
      },
      "UsageInsightRate": {
        "type": "object",
        "required": [
          "category",
          "provider",
          "sku",
          "quantityKey",
          "microsPerUnit",
          "effectiveFrom"
        ],
        "properties": {
          "category": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "quantityKey": {
            "type": "string",
            "description": "The `quantities` key the rate prices"
          },
          "microsPerUnit": {
            "type": "string",
            "description": "Decimal µUSD per unit (numeric text; may be a fraction of a µUSD)"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "UsageRate": {
        "type": "object",
        "required": [
          "id",
          "category",
          "provider",
          "sku",
          "quantityKey",
          "microsPerUnit",
          "effectiveFrom",
          "note",
          "createdAt",
          "createdByUserId"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "category": {
            "type": "string",
            "enum": [
              "llm",
              "embedding",
              "email",
              "sms",
              "storage_op",
              "outbound_http",
              "realtime",
              "compute"
            ]
          },
          "provider": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "quantityKey": {
            "type": "string",
            "description": "The `quantities` key the rate prices"
          },
          "microsPerUnit": {
            "type": "string",
            "description": "Exact decimal µUSD per unit (numeric text, never a float)"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date"
          },
          "note": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdByUserId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        }
      },
      "UsageRateList": {
        "type": "object",
        "required": [
          "rows"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageRate"
            }
          }
        }
      },
      "UsageRateCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "category",
          "provider",
          "sku",
          "quantityKey",
          "microsPerUnit"
        ],
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "llm",
              "embedding",
              "email",
              "sms",
              "storage_op",
              "outbound_http",
              "realtime",
              "compute"
            ]
          },
          "provider": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "sku": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "quantityKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "microsPerUnit": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^\\+?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$",
            "description": "Exact decimal text, ≥ 0: at most 12 fractional digits and 18 integer digits (trailing fractional zeros do not count; exponent form such as `1e-3` is read exactly). Returned in plain form."
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date",
            "description": "Default: today (UTC)"
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "UsageRatePatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "microsPerUnit": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^\\+?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$",
            "description": "Exact decimal text, ≥ 0: at most 12 fractional digits and 18 integer digits (trailing fractional zeros do not count; exponent form such as `1e-3` is read exactly). Returned in plain form."
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date"
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "UsageFixedCost": {
        "type": "object",
        "required": [
          "id",
          "provider",
          "label",
          "monthlyMicros",
          "effectiveFrom",
          "effectiveTo",
          "note",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "provider": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "monthlyMicros": {
            "type": "integer",
            "description": "µUSD a month, prorated by day"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date"
          },
          "effectiveTo": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Last day it charges (inclusive); null ⇒ still in effect"
          },
          "note": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UsageFixedCostList": {
        "type": "object",
        "required": [
          "rows"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageFixedCost"
            }
          }
        }
      },
      "UsageFixedCostCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "label",
          "monthlyMicros",
          "effectiveFrom"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "monthlyMicros": {
            "type": "integer",
            "minimum": 0
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date"
          },
          "effectiveTo": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "UsageFixedCostPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "monthlyMicros": {
            "type": "integer",
            "minimum": 0
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date"
          },
          "effectiveTo": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "UsageInsightItem": {
        "type": "object",
        "required": [
          "category",
          "provider",
          "sku",
          "quantities",
          "capturedMicros",
          "costMicros",
          "source",
          "unpricedLines",
          "lines",
          "rates"
        ],
        "properties": {
          "category": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "quantities": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "description": "Key-wise sums of the quantities (requests, input_tokens, minutes, …)"
          },
          "capturedMicros": {
            "type": "integer",
            "description": "Sum of the prices captured on the platform-paid lines"
          },
          "costMicros": {
            "type": "integer",
            "nullable": true,
            "description": "Priced per (item, day): a rate in effect overrides the captured price. null ⇒ unpriced; a non-zero `unpricedLines` ⇒ a floor"
          },
          "source": {
            "type": "string",
            "enum": [
              "rate",
              "captured",
              "unpriced",
              "mixed",
              "customer_key"
            ],
            "description": "How the range was priced; `mixed` when days differ (a rate starting mid-range), `customer_key` when none of it was platform-paid"
          },
          "unpricedLines": {
            "type": "integer"
          },
          "lines": {
            "type": "integer"
          },
          "rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageInsightRate"
            },
            "description": "The rates in effect on some day of the range"
          }
        }
      },
      "UsageInsightItems": {
        "type": "object",
        "required": [
          "from",
          "to",
          "items"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageInsightItem"
            }
          }
        }
      },
      "UsageInsightRunRate": {
        "type": "object",
        "required": [
          "month",
          "elapsedDays",
          "daysInMonth",
          "directToDateMicros",
          "fixedMonthMicros",
          "projectedMonthMicros",
          "unpricedItems",
          "byCategory"
        ],
        "properties": {
          "month": {
            "type": "string",
            "description": "YYYY-MM"
          },
          "elapsedDays": {
            "type": "integer",
            "description": "Complete days: through yesterday (UTC) for the current month"
          },
          "daysInMonth": {
            "type": "integer"
          },
          "directToDateMicros": {
            "type": "integer",
            "nullable": true,
            "description": "Direct cost over the elapsed days; null ⇒ every part of it is unpriced. Unpriced items add 0 to a priced total, so `unpricedItems` > 0 ⇒ a floor"
          },
          "fixedMonthMicros": {
            "type": "integer",
            "description": "The month's fixed cost, prorated by day"
          },
          "projectedMonthMicros": {
            "type": "integer",
            "description": "direct to date (null ⇒ 0) ÷ elapsed days × days in month + fixed"
          },
          "unpricedItems": {
            "type": "integer",
            "description": "Items with unpriced lines; > 0 ⇒ the direct figures are a floor"
          },
          "byCategory": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "category",
                "directMicros"
              ],
              "properties": {
                "category": {
                  "type": "string"
                },
                "directMicros": {
                  "type": "integer",
                  "nullable": true,
                  "description": "µUSD; null ⇒ every part of it is unpriced"
                }
              }
            }
          }
        }
      },
      "UsageLlmTokens": {
        "type": "object",
        "required": [
          "input",
          "output",
          "cacheRead",
          "cacheWrite",
          "reasoning"
        ],
        "properties": {
          "input": {
            "type": "number"
          },
          "output": {
            "type": "number",
            "description": "All output, reasoning included"
          },
          "cacheRead": {
            "type": "number"
          },
          "cacheWrite": {
            "type": "number"
          },
          "reasoning": {
            "type": "number"
          }
        }
      },
      "UsageInsightOverviewPoint": {
        "type": "object",
        "required": [
          "start",
          "requests",
          "bytesIn",
          "bytesOut",
          "serverMs",
          "dbMs",
          "llmTokens",
          "embeddings",
          "emails",
          "smsSegments",
          "storageOps",
          "directMicros",
          "unpricedLines"
        ],
        "properties": {
          "start": {
            "type": "string",
            "format": "date",
            "description": "First day of the bucket (a week starts Monday, UTC); may precede `from`"
          },
          "requests": {
            "type": "number"
          },
          "bytesIn": {
            "type": "number"
          },
          "bytesOut": {
            "type": "number"
          },
          "serverMs": {
            "type": "number"
          },
          "dbMs": {
            "type": "number"
          },
          "llmTokens": {
            "$ref": "#/components/schemas/UsageLlmTokens"
          },
          "embeddings": {
            "type": "number",
            "description": "Embedding calls"
          },
          "emails": {
            "type": "number"
          },
          "smsSegments": {
            "type": "number",
            "description": "SMS segments, plus one per send with no segment count"
          },
          "storageOps": {
            "type": "number"
          },
          "directMicros": {
            "type": "integer",
            "nullable": true,
            "description": "µUSD; null ⇒ every part of it is unpriced"
          },
          "unpricedLines": {
            "type": "integer",
            "description": "Lines with no price or an incomplete one; > 0 ⇒ `directMicros` is a floor"
          }
        }
      },
      "UsageInsightOverview": {
        "type": "object",
        "required": [
          "interval",
          "points"
        ],
        "properties": {
          "interval": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month"
            ]
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageInsightOverviewPoint"
            }
          }
        }
      },
      "UsageInsightBreakdownRow": {
        "type": "object",
        "required": [
          "key",
          "label",
          "requests",
          "serverMs",
          "dbMs",
          "llmTokens",
          "directMicros",
          "hostingShareMicros",
          "estimatedMicros",
          "unpricedLines"
        ],
        "properties": {
          "key": {
            "type": "string",
            "format": "uuid",
            "description": "The nil uuid is the unattributed row"
          },
          "label": {
            "type": "string",
            "description": "Name / handle; `Unattributed` for the nil key; the key when unresolved"
          },
          "requests": {
            "type": "number"
          },
          "serverMs": {
            "type": "number"
          },
          "dbMs": {
            "type": "number"
          },
          "llmTokens": {
            "$ref": "#/components/schemas/UsageLlmTokens"
          },
          "directMicros": {
            "type": "integer",
            "nullable": true,
            "description": "µUSD; null ⇒ every part of it is unpriced"
          },
          "hostingShareMicros": {
            "type": "integer",
            "description": "Estimate: fixed cost × row (server + db ms) ÷ platform (server + db ms); each row is rounded separately, so rows may differ from fixedMicros by under 1 µUSD per row"
          },
          "estimatedMicros": {
            "type": "integer",
            "description": "Estimate: direct + hosting share"
          },
          "unpricedLines": {
            "type": "integer"
          }
        }
      },
      "UsageInsightBreakdown": {
        "type": "object",
        "required": [
          "by",
          "total",
          "fixedMicros",
          "rows"
        ],
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "organization",
              "ecosystem",
              "user",
              "persona"
            ]
          },
          "total": {
            "type": "integer",
            "description": "Rows before paging"
          },
          "fixedMicros": {
            "type": "integer",
            "description": "Fixed cost over the range (the shared pool)"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageInsightBreakdownRow"
            }
          }
        }
      },
      "UsageInsightBreakdownDetail": {
        "type": "object",
        "required": [
          "by",
          "key",
          "label",
          "items",
          "daily"
        ],
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "organization",
              "ecosystem",
              "user",
              "persona"
            ]
          },
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageInsightItem"
            }
          },
          "daily": {
            "type": "array",
            "description": "Every day of the range",
            "items": {
              "type": "object",
              "required": [
                "day",
                "directMicros",
                "unpricedLines",
                "requests"
              ],
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "directMicros": {
                  "type": "integer",
                  "nullable": true,
                  "description": "µUSD; null ⇒ every part of it is unpriced"
                },
                "unpricedLines": {
                  "type": "integer",
                  "description": "Lines with no price or an incomplete one; > 0 ⇒ `directMicros` is a floor"
                },
                "requests": {
                  "type": "number"
                }
              }
            }
          }
        }
      },
      "Workspace": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "type"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "description": "Routable workspace slug (caller-scoped)"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "individual",
              "organization",
              "team"
            ]
          }
        }
      },
      "WorkspaceMember": {
        "type": "object",
        "required": [
          "userId",
          "isAdmin",
          "addedAt"
        ],
        "properties": {
          "userId": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "isAdmin": {
            "type": "boolean",
            "description": "Admin of any of the org's teams (the roster's strongest role)"
          },
          "addedAt": {
            "type": "string",
            "description": "Earliest membership across the org's teams"
          }
        }
      },
      "ArchivedWorkspace": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "type",
          "archivedAt",
          "handleAvailable",
          "canRestore"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The organization id — what POST /organization/organizations/{id}/restore takes"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "organization"
            ]
          },
          "archivedAt": {
            "type": "string",
            "description": "When the organization was archived (DB timestamp text, not RFC3339)"
          },
          "handleAvailable": {
            "type": "boolean",
            "description": "False once org.<slug> has been claimed by someone else — a restore would 409"
          },
          "canRestore": {
            "type": "boolean",
            "description": "False when the caller can see the org (they are a member) but may not restore it. True for the org's creator, an admin of one of its live org-owned teams, or a site admin."
          }
        }
      }
    }
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Liveness probe",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/system/version": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Build / version info",
        "responses": {
          "200": {
            "description": "version"
          }
        }
      }
    },
    "/auth/register": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Create an account (email + password)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password",
                  "name"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "token + refreshToken + user",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/AuthResult"
                    },
                    {
                      "type": "object",
                      "required": [
                        "emailVerificationRequired"
                      ],
                      "properties": {
                        "emailVerificationRequired": {
                          "type": "boolean"
                        },
                        "emailInUse": {
                          "type": "boolean"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Sign in (may require a second factor)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address"
                  },
                  "slug": {
                    "type": "string",
                    "description": "User id (login handle)"
                  },
                  "identifier": {
                    "type": "string",
                    "description": "Email, user id, or a verified phone number (E.164) — classified server-side"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "token + refreshToken + user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResult"
                }
              }
            }
          },
          "202": {
            "description": "second factor required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaChallenge"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/login/mfa/sms/send": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Send the SMS login code to the verified primary phone",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "MFA pending token"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "code sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/login/mfa": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Complete login by satisfying the second factor → aal=2 session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "method",
                  "code"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "MFA pending token"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "sms",
                      "totp",
                      "recovery"
                    ]
                  },
                  "code": {
                    "type": "string",
                    "maxLength": 40
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "token + refreshToken + user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/login/mfa/webauthn/options": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "WebAuthn 2nd-factor: assertion options bound to the pending challenge",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "MFA pending token"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "options + next pending token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "options",
                    "token"
                  ],
                  "properties": {
                    "options": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "PublicKeyCredentialRequestOptionsJSON"
                    },
                    "token": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/login/mfa/webauthn": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "WebAuthn 2nd-factor: verify the assertion → aal=2 session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "response"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "response": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "AuthenticationResponseJSON"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "token + refreshToken + user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/login/webauthn/options": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Passwordless passkey: assertion options for an account",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "identifier"
                ],
                "properties": {
                  "identifier": {
                    "type": "string",
                    "description": "Email or login slug"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "options + login challenge token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "options",
                    "token"
                  ],
                  "properties": {
                    "options": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "token": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/login/webauthn": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Passwordless passkey: verify the assertion → aal=2 session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "response"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "response": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "AuthenticationResponseJSON"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "token + refreshToken + user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/refresh": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Rotate refresh token → new JWT",
        "responses": {
          "200": {
            "description": "token + refreshToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/revoke": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Sign out (revoke refresh token)",
        "responses": {
          "204": {
            "description": "revoked"
          }
        }
      }
    },
    "/auth/me": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Current user",
        "description": "A platform token answers the hub user (User). An end-customer token (client-auth) answers its customer record in the customer realm instead — the CustomerMe schema, linked from the 200 response's `x-customer-realm`. For a customer token, a customer row that is gone (or an ecosystem that is deleted, archived or has login disabled) is 401, never 404; 404 is the platform user-not-found case only.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            },
            "x-customer-realm": {
              "$ref": "#/components/schemas/CustomerMe"
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "auth"
        ],
        "summary": "Update the caller's own profile (name, slug, avatar, public-profile toggle)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one profile field is required.",
                "minProperties": 1,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
                  },
                  "avatarUrl": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 1024
                  },
                  "publicProfileEnabled": {
                    "type": "boolean"
                  },
                  "profileVisibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "hub",
                      "private"
                    ],
                    "description": "The principal's page-level profile visibility. Supersedes publicProfileEnabled, which is retained during the expand phase and written in parallel."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "user (same shape as GET /auth/me)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/slug-available/{slug}": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Check whether a login slug is available to the caller",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "availability",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "available"
                  ],
                  "properties": {
                    "available": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "format",
                        "taken"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/revoke-all": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Revoke all sessions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "revoked"
          }
        }
      }
    },
    "/auth/change-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Change password (revokes sessions)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "currentPassword",
                  "newPassword"
                ],
                "properties": {
                  "currentPassword": {
                    "type": "string"
                  },
                  "newPassword": {
                    "type": "string",
                    "minLength": 8
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "changed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/tokens": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List the caller’s API tokens (metadata only; raw values never returned)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "API tokens",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiToken"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Mint an API token (raw value shown once)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "nullable": true
                  },
                  "scope": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "REST path prefixes the token may reach"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "API token + raw value (shown once)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTokenCreated"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/tokens/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Revoke an API token",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "revoked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/tokens/scopes": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List available REST path-prefix scopes that may be assigned to an API token",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "scope prefixes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "prefixes"
                  ],
                  "properties": {
                    "prefixes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Distinct 2-segment path prefixes derived from the live OpenAPI spec (e.g. \"/content/markdown\")"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/applications/{appId}/tokens": {
      "parameters": [
        {
          "name": "appId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "List an application’s API tokens (metadata only; raw values never returned)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "API tokens",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiToken"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Mint an API token for the application (raw value shown once)",
        "description": "The application must belong to the caller’s ecosystem (404 otherwise). Minting also grants the app CRUD on every storage bucket a feature provisioned in its ecosystem, so the token works immediately.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "API token + raw value (shown once)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTokenCreated"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/applications/{appId}/tokens/{id}": {
      "parameters": [
        {
          "name": "appId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Revoke one of the application’s API tokens",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "revoked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/move": {
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Move an ecosystem-scoped row (and its aggregate children) to another ecosystem (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "schema",
                  "table",
                  "id",
                  "target"
                ],
                "properties": {
                  "schema": {
                    "type": "string",
                    "description": "Postgres schema of the row’s table"
                  },
                  "table": {
                    "type": "string",
                    "description": "table name within the schema"
                  },
                  "id": {
                    "type": "string",
                    "description": "row id (uuid, or an rdid for rdid-addressed tables)"
                  },
                  "target": {
                    "type": "string",
                    "description": "destination ecosystem (uuid or rdid)"
                  },
                  "dryRun": {
                    "type": "boolean",
                    "description": "report what would move without writing"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Source/destination ecosystem + per-table moved counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema": {
                      "type": "string"
                    },
                    "table": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    },
                    "moved": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ownership/transfer": {
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Transfer an object to another workspace (admin of both sides)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "entityType",
                  "entityId",
                  "target"
                ],
                "properties": {
                  "entityType": {
                    "type": "string",
                    "enum": [
                      "persona",
                      "ecosystem",
                      "application",
                      "bucket",
                      "project",
                      "site-group"
                    ],
                    "description": "a transferable entity type, from the server’s TRANSFER_PLANS registry"
                  },
                  "entityId": {
                    "type": "string",
                    "description": "the object’s rdid or uuid"
                  },
                  "target": {
                    "type": "string",
                    "description": "destination workspace slug (or ecosystem rdid, per the entity)"
                  },
                  "targetKind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "organization"
                    ],
                    "description": "the namespace `target` names, when the client knows it"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The object’s new address, plus what the transfer revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "nullable": true,
                      "description": "the rdid the object now has"
                    },
                    "previousId": {
                      "type": "string",
                      "nullable": true
                    },
                    "rewritten": {
                      "type": "integer",
                      "description": "addresses re-derived by the cascade"
                    },
                    "revoked": {
                      "type": "object",
                      "properties": {
                        "tokens": {
                          "type": "integer",
                          "description": "API tokens revoked"
                        },
                        "subjects": {
                          "type": "array",
                          "description": "principals that lose reach over the object once it moves",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "team",
                                  "persona",
                                  "organization",
                                  "app",
                                  "token"
                                ]
                              },
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "via": {
                                "type": "string",
                                "enum": [
                                  "role",
                                  "team",
                                  "direct",
                                  "participant",
                                  "group"
                                ],
                                "description": "where the access came from"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ownership/transfer/preview": {
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "What a transfer would do, without doing it",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "entityType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "persona",
                "ecosystem",
                "application",
                "bucket",
                "project",
                "site-group"
              ],
              "description": "a transferable entity type, from the server’s TRANSFER_PLANS registry"
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "targetKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "customer",
                "organization"
              ],
              "description": "the namespace `target` names, when the client knows it"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Who would lose access, and the address the object holds today",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "previousId": {
                      "type": "string",
                      "nullable": true
                    },
                    "tokens": {
                      "type": "integer",
                      "description": "API tokens the transfer would revoke"
                    },
                    "revoking": {
                      "type": "array",
                      "description": "principals that lose reach over the object once it moves",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "user",
                              "team",
                              "persona",
                              "organization",
                              "app",
                              "token"
                            ]
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "via": {
                            "type": "string",
                            "enum": [
                              "role",
                              "team",
                              "direct",
                              "participant",
                              "group"
                            ],
                            "description": "where the access came from"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ownership/owned": {
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "What a customer, organization, persona or ecosystem still owns",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "customer",
                "organization",
                "application",
                "persona",
                "ecosystem"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tables it owns rows in, with counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "customer",
                        "organization",
                        "application",
                        "persona",
                        "ecosystem"
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "owned": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "table",
                          "rows"
                        ],
                        "properties": {
                          "table": {
                            "type": "string",
                            "description": "`<schema>.<table>`"
                          },
                          "rows": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ownership/erase": {
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Hard-delete everything a principal owns",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kind",
                  "id"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "organization",
                      "application",
                      "persona",
                      "ecosystem"
                    ]
                  },
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was erased",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "customer",
                        "organization",
                        "application",
                        "persona",
                        "ecosystem"
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "erased": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "table",
                          "rows"
                        ],
                        "properties": {
                          "table": {
                            "type": "string",
                            "description": "`<schema>.<table>`"
                          },
                          "rows": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refused, nothing erased (error.code = \"erase_blocked\")",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ownership/handover": {
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Give everything one principal owns to another of the same kind",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kind",
                  "from",
                  "to"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "persona"
                    ]
                  },
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What moved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "customer",
                        "persona"
                      ]
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    },
                    "moved": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "table",
                          "rows"
                        ],
                        "properties": {
                          "table": {
                            "type": "string",
                            "description": "`<schema>.<table>`"
                          },
                          "rows": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/capabilities": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List all capability grants, or one user via ?userId (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "capabilities"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/capabilities/grant": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Grant a capability to a user (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "capability"
                ],
                "properties": {
                  "userId": {
                    "type": "string"
                  },
                  "capability": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "granted"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/capabilities/revoke": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Revoke a capability from a user (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "capability"
                ],
                "properties": {
                  "userId": {
                    "type": "string"
                  },
                  "capability": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "revoked"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refused: this would leave no live operator (error.code = \"last_operator\"). Make someone else an operator first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/clients": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "List OAuth clients (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OAuth clients",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "slug",
                      "name",
                      "allowedReturnOrigins",
                      "originsManaged",
                      "isInternal"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "allowedReturnOrigins": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "originsManaged": {
                        "type": "boolean",
                        "description": "The deployment sets these return origins, so they cannot be edited here. A site adds its origin on its application."
                      },
                      "defaultEcosystemId": {
                        "type": "string",
                        "nullable": true
                      },
                      "isInternal": {
                        "type": "boolean"
                      },
                      "appTokenPrefix": {
                        "type": "string",
                        "nullable": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Create an OAuth client + issue its app token (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "defaultEcosystemId"
                ],
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "allowedReturnOrigins": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "defaultEcosystemId": {
                    "type": "string"
                  },
                  "jwtAudience": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Client + one-time app token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "client"
                  ],
                  "properties": {
                    "client": {
                      "type": "object",
                      "required": [
                        "id",
                        "slug",
                        "name",
                        "allowedReturnOrigins",
                        "originsManaged",
                        "isInternal"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "allowedReturnOrigins": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "originsManaged": {
                          "type": "boolean",
                          "description": "The deployment sets these return origins, so they cannot be edited here. A site adds its origin on its application."
                        },
                        "defaultEcosystemId": {
                          "type": "string",
                          "nullable": true
                        },
                        "isInternal": {
                          "type": "boolean"
                        },
                        "appTokenPrefix": {
                          "type": "string",
                          "nullable": true
                        }
                      }
                    },
                    "appToken": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/clients/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Get a client + its linked providers (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Client + linked providers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "client",
                    "providers"
                  ],
                  "properties": {
                    "client": {
                      "type": "object",
                      "required": [
                        "id",
                        "slug",
                        "name",
                        "allowedReturnOrigins",
                        "originsManaged",
                        "isInternal"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "allowedReturnOrigins": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "originsManaged": {
                          "type": "boolean",
                          "description": "The deployment sets these return origins, so they cannot be edited here. A site adds its origin on its application."
                        },
                        "defaultEcosystemId": {
                          "type": "string",
                          "nullable": true
                        },
                        "isInternal": {
                          "type": "boolean"
                        },
                        "appTokenPrefix": {
                          "type": "string",
                          "nullable": true
                        }
                      }
                    },
                    "providers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "slug",
                          "name",
                          "authType"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "authType": {
                            "type": "string",
                            "enum": [
                              "oauth2_code",
                              "oauth2_access_token",
                              "oidc_id_token"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "oauth"
        ],
        "summary": "Update a client (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "defaultEcosystemId"
                ],
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "allowedReturnOrigins": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "defaultEcosystemId": {
                    "type": "string"
                  },
                  "jwtAudience": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "allowedReturnOrigins",
                    "originsManaged",
                    "isInternal"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "allowedReturnOrigins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "originsManaged": {
                      "type": "boolean",
                      "description": "The deployment sets these return origins, so they cannot be edited here. A site adds its origin on its application."
                    },
                    "defaultEcosystemId": {
                      "type": "string",
                      "nullable": true
                    },
                    "isInternal": {
                      "type": "boolean"
                    },
                    "appTokenPrefix": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "oauth"
        ],
        "summary": "Delete a client (admin; internal clients are protected)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/clients/{slug}/rotate-token": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Rotate a client app token (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "One-time app token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "appToken",
                    "appTokenPrefix"
                  ],
                  "properties": {
                    "appToken": {
                      "type": "string"
                    },
                    "appTokenPrefix": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/clients/{slug}/providers/{providerSlug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "providerSlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "oauth"
        ],
        "summary": "Link a provider to a client, optional per-client credential override (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clientIdOverride": {
                    "type": "string",
                    "nullable": true
                  },
                  "clientSecretOverride": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Provider linked to client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "clientSlug",
                    "providerSlug",
                    "hasOverrides"
                  ],
                  "properties": {
                    "clientSlug": {
                      "type": "string"
                    },
                    "providerSlug": {
                      "type": "string"
                    },
                    "hasOverrides": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "oauth"
        ],
        "summary": "Unlink a provider from a client (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "unlinked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/provider-templates": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Built-in provider templates (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Built-in provider templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "templates"
                  ],
                  "properties": {
                    "templates": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "slug",
                          "name",
                          "authType",
                          "identityMapping"
                        ],
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "authType": {
                            "type": "string",
                            "enum": [
                              "oauth2_code",
                              "oauth2_access_token",
                              "oidc_id_token"
                            ]
                          },
                          "authorizeUrl": {
                            "type": "string",
                            "nullable": true
                          },
                          "tokenUrl": {
                            "type": "string",
                            "nullable": true
                          },
                          "userinfoUrl": {
                            "type": "string",
                            "nullable": true
                          },
                          "defaultScopes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "identityMapping": {
                            "type": "object",
                            "required": [
                              "subjectField",
                              "emailField",
                              "nameField",
                              "avatarField"
                            ],
                            "properties": {
                              "subjectField": {
                                "type": "string"
                              },
                              "emailField": {
                                "type": "string"
                              },
                              "nameField": {
                                "type": "string"
                              },
                              "avatarField": {
                                "type": "string"
                              },
                              "verificationUrl": {
                                "type": "string"
                              },
                              "jwksUrl": {
                                "type": "string"
                              },
                              "requireEmailVerified": {
                                "type": "boolean"
                              },
                              "emailVerifiedField": {
                                "type": "string"
                              },
                              "trustedEmailTenants": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "allowedAudiences": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "secondaryEmailUrl": {
                                "type": "string"
                              },
                              "idTokenJwksUrl": {
                                "type": "string"
                              },
                              "idTokenIssuers": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "responseMode": {
                                "type": "string",
                                "enum": [
                                  "form_post"
                                ]
                              },
                              "clientSecretJwt": {
                                "type": "object",
                                "required": [
                                  "teamId",
                                  "keyId",
                                  "audience"
                                ],
                                "properties": {
                                  "teamId": {
                                    "type": "string"
                                  },
                                  "keyId": {
                                    "type": "string"
                                  },
                                  "audience": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/providers": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "List OAuth providers (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OAuth providers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "slug",
                      "name",
                      "authType",
                      "clientId",
                      "scopes",
                      "identityMapping"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "authType": {
                        "type": "string",
                        "enum": [
                          "oauth2_code",
                          "oauth2_access_token",
                          "oidc_id_token"
                        ]
                      },
                      "authorizeUrl": {
                        "type": "string",
                        "nullable": true
                      },
                      "tokenUrl": {
                        "type": "string",
                        "nullable": true
                      },
                      "userinfoUrl": {
                        "type": "string",
                        "nullable": true
                      },
                      "clientId": {
                        "type": "string"
                      },
                      "scopes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "identityMapping": {
                        "type": "object",
                        "required": [
                          "subjectField",
                          "emailField",
                          "nameField",
                          "avatarField"
                        ],
                        "properties": {
                          "subjectField": {
                            "type": "string"
                          },
                          "emailField": {
                            "type": "string"
                          },
                          "nameField": {
                            "type": "string"
                          },
                          "avatarField": {
                            "type": "string"
                          },
                          "verificationUrl": {
                            "type": "string"
                          },
                          "jwksUrl": {
                            "type": "string"
                          },
                          "requireEmailVerified": {
                            "type": "boolean"
                          },
                          "emailVerifiedField": {
                            "type": "string"
                          },
                          "trustedEmailTenants": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "allowedAudiences": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "secondaryEmailUrl": {
                            "type": "string"
                          },
                          "idTokenJwksUrl": {
                            "type": "string"
                          },
                          "idTokenIssuers": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "responseMode": {
                            "type": "string",
                            "enum": [
                              "form_post"
                            ]
                          },
                          "clientSecretJwt": {
                            "type": "object",
                            "required": [
                              "teamId",
                              "keyId",
                              "audience"
                            ],
                            "properties": {
                              "teamId": {
                                "type": "string"
                              },
                              "keyId": {
                                "type": "string"
                              },
                              "audience": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Create a provider from a template or full spec (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clientId",
                  "clientSecret"
                ],
                "properties": {
                  "templateSlug": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "clientSecret": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "authorizeUrl": {
                    "type": "string",
                    "nullable": true
                  },
                  "tokenUrl": {
                    "type": "string",
                    "nullable": true
                  },
                  "userinfoUrl": {
                    "type": "string",
                    "nullable": true
                  },
                  "authType": {
                    "type": "string",
                    "enum": [
                      "oauth2_code",
                      "oauth2_access_token",
                      "oidc_id_token"
                    ]
                  },
                  "identityMapping": {
                    "type": "object",
                    "required": [
                      "subjectField",
                      "emailField",
                      "nameField",
                      "avatarField"
                    ],
                    "properties": {
                      "subjectField": {
                        "type": "string"
                      },
                      "emailField": {
                        "type": "string"
                      },
                      "nameField": {
                        "type": "string"
                      },
                      "avatarField": {
                        "type": "string"
                      },
                      "verificationUrl": {
                        "type": "string"
                      },
                      "requireEmailVerified": {
                        "type": "boolean"
                      },
                      "emailVerifiedField": {
                        "type": "string"
                      },
                      "trustedEmailTenants": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "allowedAudiences": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "secondaryEmailUrl": {
                        "type": "string"
                      },
                      "idTokenJwksUrl": {
                        "type": "string"
                      },
                      "idTokenIssuers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "responseMode": {
                        "type": "string",
                        "enum": [
                          "form_post"
                        ]
                      },
                      "clientSecretJwt": {
                        "type": "object",
                        "required": [
                          "teamId",
                          "keyId",
                          "audience"
                        ],
                        "properties": {
                          "teamId": {
                            "type": "string"
                          },
                          "keyId": {
                            "type": "string"
                          },
                          "audience": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Provider",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "authType",
                    "clientId",
                    "scopes",
                    "identityMapping"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "authType": {
                      "type": "string",
                      "enum": [
                        "oauth2_code",
                        "oauth2_access_token",
                        "oidc_id_token"
                      ]
                    },
                    "authorizeUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "tokenUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "userinfoUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "clientId": {
                      "type": "string"
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "identityMapping": {
                      "type": "object",
                      "required": [
                        "subjectField",
                        "emailField",
                        "nameField",
                        "avatarField"
                      ],
                      "properties": {
                        "subjectField": {
                          "type": "string"
                        },
                        "emailField": {
                          "type": "string"
                        },
                        "nameField": {
                          "type": "string"
                        },
                        "avatarField": {
                          "type": "string"
                        },
                        "verificationUrl": {
                          "type": "string"
                        },
                        "jwksUrl": {
                          "type": "string"
                        },
                        "requireEmailVerified": {
                          "type": "boolean"
                        },
                        "emailVerifiedField": {
                          "type": "string"
                        },
                        "trustedEmailTenants": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "allowedAudiences": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "secondaryEmailUrl": {
                          "type": "string"
                        },
                        "idTokenJwksUrl": {
                          "type": "string"
                        },
                        "idTokenIssuers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "responseMode": {
                          "type": "string",
                          "enum": [
                            "form_post"
                          ]
                        },
                        "clientSecretJwt": {
                          "type": "object",
                          "required": [
                            "teamId",
                            "keyId",
                            "audience"
                          ],
                          "properties": {
                            "teamId": {
                              "type": "string"
                            },
                            "keyId": {
                              "type": "string"
                            },
                            "audience": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/providers/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Get a provider (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Provider",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "authType",
                    "clientId",
                    "scopes",
                    "identityMapping"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "authType": {
                      "type": "string",
                      "enum": [
                        "oauth2_code",
                        "oauth2_access_token",
                        "oidc_id_token"
                      ]
                    },
                    "authorizeUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "tokenUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "userinfoUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "clientId": {
                      "type": "string"
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "identityMapping": {
                      "type": "object",
                      "required": [
                        "subjectField",
                        "emailField",
                        "nameField",
                        "avatarField"
                      ],
                      "properties": {
                        "subjectField": {
                          "type": "string"
                        },
                        "emailField": {
                          "type": "string"
                        },
                        "nameField": {
                          "type": "string"
                        },
                        "avatarField": {
                          "type": "string"
                        },
                        "verificationUrl": {
                          "type": "string"
                        },
                        "jwksUrl": {
                          "type": "string"
                        },
                        "requireEmailVerified": {
                          "type": "boolean"
                        },
                        "emailVerifiedField": {
                          "type": "string"
                        },
                        "trustedEmailTenants": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "allowedAudiences": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "secondaryEmailUrl": {
                          "type": "string"
                        },
                        "idTokenJwksUrl": {
                          "type": "string"
                        },
                        "idTokenIssuers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "responseMode": {
                          "type": "string",
                          "enum": [
                            "form_post"
                          ]
                        },
                        "clientSecretJwt": {
                          "type": "object",
                          "required": [
                            "teamId",
                            "keyId",
                            "audience"
                          ],
                          "properties": {
                            "teamId": {
                              "type": "string"
                            },
                            "keyId": {
                              "type": "string"
                            },
                            "audience": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "oauth"
        ],
        "summary": "Update a provider (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "clientSecret": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "authorizeUrl": {
                    "type": "string",
                    "nullable": true
                  },
                  "tokenUrl": {
                    "type": "string",
                    "nullable": true
                  },
                  "userinfoUrl": {
                    "type": "string",
                    "nullable": true
                  },
                  "identityMapping": {
                    "type": "object",
                    "required": [
                      "subjectField",
                      "emailField",
                      "nameField",
                      "avatarField"
                    ],
                    "properties": {
                      "subjectField": {
                        "type": "string"
                      },
                      "emailField": {
                        "type": "string"
                      },
                      "nameField": {
                        "type": "string"
                      },
                      "avatarField": {
                        "type": "string"
                      },
                      "verificationUrl": {
                        "type": "string"
                      },
                      "requireEmailVerified": {
                        "type": "boolean"
                      },
                      "emailVerifiedField": {
                        "type": "string"
                      },
                      "trustedEmailTenants": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "allowedAudiences": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "secondaryEmailUrl": {
                        "type": "string"
                      },
                      "idTokenJwksUrl": {
                        "type": "string"
                      },
                      "idTokenIssuers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "responseMode": {
                        "type": "string",
                        "enum": [
                          "form_post"
                        ]
                      },
                      "clientSecretJwt": {
                        "type": "object",
                        "required": [
                          "teamId",
                          "keyId",
                          "audience"
                        ],
                        "properties": {
                          "teamId": {
                            "type": "string"
                          },
                          "keyId": {
                            "type": "string"
                          },
                          "audience": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Provider",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "authType",
                    "clientId",
                    "scopes",
                    "identityMapping"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "authType": {
                      "type": "string",
                      "enum": [
                        "oauth2_code",
                        "oauth2_access_token",
                        "oidc_id_token"
                      ]
                    },
                    "authorizeUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "tokenUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "userinfoUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "clientId": {
                      "type": "string"
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "identityMapping": {
                      "type": "object",
                      "required": [
                        "subjectField",
                        "emailField",
                        "nameField",
                        "avatarField"
                      ],
                      "properties": {
                        "subjectField": {
                          "type": "string"
                        },
                        "emailField": {
                          "type": "string"
                        },
                        "nameField": {
                          "type": "string"
                        },
                        "avatarField": {
                          "type": "string"
                        },
                        "verificationUrl": {
                          "type": "string"
                        },
                        "jwksUrl": {
                          "type": "string"
                        },
                        "requireEmailVerified": {
                          "type": "boolean"
                        },
                        "emailVerifiedField": {
                          "type": "string"
                        },
                        "trustedEmailTenants": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "allowedAudiences": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "secondaryEmailUrl": {
                          "type": "string"
                        },
                        "idTokenJwksUrl": {
                          "type": "string"
                        },
                        "idTokenIssuers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "responseMode": {
                          "type": "string",
                          "enum": [
                            "form_post"
                          ]
                        },
                        "clientSecretJwt": {
                          "type": "object",
                          "required": [
                            "teamId",
                            "keyId",
                            "audience"
                          ],
                          "properties": {
                            "teamId": {
                              "type": "string"
                            },
                            "keyId": {
                              "type": "string"
                            },
                            "audience": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "oauth"
        ],
        "summary": "Delete a provider (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/providers": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "OAuth providers available for a client",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "providers"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/discovery": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Client-auth discovery: issuer, endpoints, sign-in apps, realm switches, providers",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ecosystem",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "discovery document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "issuer",
                    "authorizationEndpoint",
                    "tokenEndpoint",
                    "ecosystemId",
                    "ecosystemName",
                    "clients",
                    "loginEnabled",
                    "signupMode",
                    "passwordEnabled",
                    "providers"
                  ],
                  "properties": {
                    "issuer": {
                      "type": "string"
                    },
                    "authorizationEndpoint": {
                      "type": "string"
                    },
                    "tokenEndpoint": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "ecosystemName": {
                      "type": "string"
                    },
                    "clients": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "clientId",
                          "name",
                          "redirectUris",
                          "providers"
                        ],
                        "properties": {
                          "clientId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "redirectUris": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "providers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "slug",
                                "name"
                              ],
                              "properties": {
                                "slug": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "loginEnabled": {
                      "type": "boolean"
                    },
                    "signupMode": {
                      "type": "string",
                      "enum": [
                        "open",
                        "invite_only",
                        "closed"
                      ]
                    },
                    "passwordEnabled": {
                      "type": "boolean"
                    },
                    "providers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "slug",
                          "name"
                        ],
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/complete": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Complete an OAuth sign-in (SPA flow) → token + refreshToken + user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clientSlug",
                  "providerSlug"
                ],
                "properties": {
                  "clientSlug": {
                    "type": "string"
                  },
                  "providerSlug": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "accessToken": {
                    "type": "string"
                  },
                  "idToken": {
                    "type": "string"
                  },
                  "redirectUri": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "token + refreshToken + user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/start": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Begin the server redirect flow → 302 to the provider",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "return",
            "in": "query",
            "required": false,
            "description": "Brand callback URL. Required unless `login_challenge` is given.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "login_challenge",
            "in": "query",
            "required": false,
            "description": "Hydra login challenge of the hosted customer sign-in page. The callback then accepts that Hydra login (303 to Hydra) instead of returning an exchange code.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "redirect to provider"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/callback": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Provider redirect target → 302 back with a single-use exchange code",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "redirect to returnUrl with code"
          },
          "303": {
            "description": "Hydra-login mode: redirect to Hydra, or back to the login page"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "The same callback, for a provider that posts it (response_mode=form_post)",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "state"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "error": {
                    "type": "string"
                  },
                  "user": {
                    "type": "string",
                    "description": "Apple's one-time name, as JSON"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "302": {
            "description": "redirect to returnUrl with code"
          },
          "303": {
            "description": "Hydra-login mode: redirect to Hydra, or back to the login page"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/exchange": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Trade a single-use exchange code → token + refreshToken + user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "token + refreshToken + user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/preflight": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Will /authorize RETURN the browser to this origin, or send it to central login?",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "return",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "whether a prompt=none check for this return would be bounced back",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "allowed"
                  ],
                  "properties": {
                    "allowed": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string",
                      "nullable": true,
                      "description": "null when allowed; else invalid_return, client_unknown or origin_not_allowed"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/authorize": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Central SSO authorize — silent re-login from the central session, else → central login",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "return",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "redirect to returnUrl with a fresh exchange code, or to the central login page"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/login": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Central credential login → sets the SSO session, returns the brand redirect URL",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clientId",
                  "return",
                  "password"
                ],
                "properties": {
                  "clientId": {
                    "type": "string"
                  },
                  "return": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "identifier": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSO session established; navigate the browser to redirectUrl",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "redirectUrl"
                  ],
                  "properties": {
                    "redirectUrl": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "second factor required — complete it centrally",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaChallenge"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/login/mfa": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Central login: satisfy the second factor → SSO session (aal=2) + brand redirect URL",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "method",
                  "code",
                  "clientId",
                  "return"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "MFA pending token"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "sms",
                      "totp",
                      "recovery"
                    ]
                  },
                  "code": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "return": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSO session established; navigate the browser to redirectUrl",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "redirectUrl"
                  ],
                  "properties": {
                    "redirectUrl": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/login/mfa/webauthn": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Central login: verify the 2nd-factor assertion → SSO session (aal=2) + brand redirect URL",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "response",
                  "clientId",
                  "return"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "response": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "AuthenticationResponseJSON"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "return": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSO session established; navigate the browser to redirectUrl",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "redirectUrl"
                  ],
                  "properties": {
                    "redirectUrl": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/login/webauthn": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Central passwordless passkey: verify the assertion → SSO session (aal=2) + brand redirect URL",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "response",
                  "clientId",
                  "return"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "response": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "AuthenticationResponseJSON"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "return": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSO session established; navigate the browser to redirectUrl",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "redirectUrl"
                  ],
                  "properties": {
                    "redirectUrl": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/signin/logout": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Central single-logout (browser) — revoke + clear the SSO cookie, then 302 back",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "return",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "logged out (no return requested)"
          },
          "302": {
            "description": "redirect to the validated return (when clientId + return are given)"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Central logout (programmatic, no redirect)",
        "responses": {
          "204": {
            "description": "logged out"
          }
        }
      }
    },
    "/processing/run": {
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Run an AI action on demand for a saved target",
        "description": "Loads the saved target server-side and enqueues a high-priority (interactive) job. Idempotent per content version via the dedup key. Returns 202 with the job id.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "targetKind",
                  "targetId"
                ],
                "properties": {
                  "targetKind": {
                    "type": "string",
                    "description": "Saved entity kind, e.g. 'content.markdown'"
                  },
                  "targetId": {
                    "type": "string",
                    "description": "Row id of the saved entity"
                  },
                  "jobType": {
                    "type": "string",
                    "description": "Optional; defaults to the registered job for the targetKind"
                  },
                  "configSetId": {
                    "type": "string",
                    "nullable": true,
                    "description": "Run under this config set. Requires admin (403 otherwise); an unknown id is 400."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job enqueued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jobId",
                    "deduped"
                  ],
                  "properties": {
                    "jobId": {
                      "type": "string"
                    },
                    "deduped": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/jobs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "Read a single job (poll for completion)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Job status + result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "claimed",
                        "succeeded",
                        "dead"
                      ]
                    },
                    "result": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/jobs/{id}/stream": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "Server-sent completion stream for a job",
        "description": "Opens an SSE stream that emits one `job` event ({ id, status, result }) when the job reaches a terminal state, then closes. Emits immediately if already terminal. Closes after 60s with no event if still running (client should fall back to polling).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "text/event-stream of job events"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/jobs/claim": {
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Claim queued jobs (worker pull)",
        "description": "Atomically claim up to `batch` queued jobs for this worker. Returns an empty array when no jobs are available — never blocks. Ecosystem-scoped via RLS to the caller's api-token.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobTypes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Filter to specific job types; absent = any type"
                  },
                  "minPriority": {
                    "type": "integer",
                    "description": "Claim only jobs with priority >= this value (interactive lane = 100)"
                  },
                  "batch": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Max jobs to claim (default 1)"
                  },
                  "leaseMs": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Lease duration in ms (default 30 000)"
                  },
                  "workerId": {
                    "type": "string",
                    "description": "Label for the claimed rows; defaults to api-token name or userId"
                  },
                  "providers": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "$ref": "#/components/schemas/AiProcessingProviderKind"
                    },
                    "description": "LLM providers this node can run; only jobs resolving to one of them are claimed. Absent = ['local']."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Claimed jobs (may be empty)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jobs"
                  ],
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiProcessingClaimedJob"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/jobs/{id}/heartbeat": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Extend the lease on a claimed job",
        "description": "Workers call this periodically while processing a slow job to prevent the reaper from reclaiming it. Returns 404 when the lease guard fails.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "leaseToken"
                ],
                "properties": {
                  "leaseToken": {
                    "type": "string",
                    "description": "Opaque lease token returned by /claim"
                  },
                  "leaseMs": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "New lease duration in ms (default 30 000)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Extended lease expiry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "leaseExpiresAt"
                  ],
                  "properties": {
                    "leaseExpiresAt": {
                      "type": "string",
                      "description": "New lease expiry timestamp"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/jobs/{id}/complete": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Mark a claimed job succeeded",
        "description": "Stores the result jsonb and transitions the job to succeeded. Returns 404 when the lease guard fails (wrong token, wrong ecosystem, or already finished). The optional `usage` array reports the LLM usage the worker ran up, one entry per provider attempt; each is recorded as a cost line against the job's ecosystem, priced from the model catalog (unpriced when the catalog has no price or the host is self-hosted), always paid by the platform. Recorded once per successful completion, after the transaction commits — a repeated call is the 404.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "leaseToken",
                  "result"
                ],
                "properties": {
                  "leaseToken": {
                    "type": "string",
                    "description": "Opaque lease token returned by /claim"
                  },
                  "result": {
                    "description": "Arbitrary result jsonb"
                  },
                  "usage": {
                    "type": "array",
                    "maxItems": 32,
                    "description": "LLM usage per provider attempt, token counts normalized: inputTokens is NON-cached input; outputTokens includes reasoning; reasoningTokens is its subset.",
                    "items": {
                      "$ref": "#/components/schemas/AiProcessingWorkerUsage"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job marked succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/jobs/{id}/fail": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Record a job failure",
        "description": "Records an error and either re-queues the job with exponential backoff (when retry:true and attempts remain) or moves it to dead. Returns 404 when the lease guard fails. The optional `usage` array is recorded exactly as on /complete — once per admitted failure, after the transaction commits.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "leaseToken",
                  "error"
                ],
                "properties": {
                  "leaseToken": {
                    "type": "string",
                    "description": "Opaque lease token returned by /claim"
                  },
                  "error": {
                    "type": "string",
                    "description": "Human-readable error stored as last_error"
                  },
                  "retry": {
                    "type": "boolean",
                    "description": "Re-queue if attempts remain (default true)"
                  },
                  "usage": {
                    "type": "array",
                    "maxItems": 32,
                    "description": "LLM usage per provider attempt, token counts normalized: inputTokens is NON-cached input; outputTokens includes reasoning; reasoningTokens is its subset.",
                    "items": {
                      "$ref": "#/components/schemas/AiProcessingWorkerUsage"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Failure recorded; retry info",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "willRetry"
                  ],
                  "properties": {
                    "willRetry": {
                      "type": "boolean",
                      "description": "True when the job was re-queued"
                    },
                    "runAt": {
                      "type": "string",
                      "nullable": true,
                      "description": "Scheduled re-run timestamp (null when dead)"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/jobs": {
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Enqueue an ad-hoc job (management)",
        "description": "Ad-hoc / explicit enqueue path (task family 3). Requires a user JWT. The caller's ecosystemId becomes the owning ecosystem. Returns { id, deduped }.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jobType",
                  "targetKind",
                  "targetId",
                  "payload"
                ],
                "properties": {
                  "jobType": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Discriminator for worker routing (e.g. categorize_and_tag)"
                  },
                  "targetKind": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Namespace of the target entity (e.g. content.markdown)"
                  },
                  "targetId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "UUID of the target entity"
                  },
                  "payload": {
                    "description": "Arbitrary job-specific input stored as jsonb"
                  },
                  "priority": {
                    "type": "integer",
                    "description": "Higher value = claimed first; defaults to 0"
                  },
                  "configSetId": {
                    "type": "string",
                    "nullable": true,
                    "description": "Run under this config set. Requires admin (403 otherwise); an unknown id is 400."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Job enqueued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deduped"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "ID of the enqueued (or existing deduped) job"
                    },
                    "deduped": {
                      "type": "boolean",
                      "description": "True when an existing job with the same dedupKey was returned"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "List ecosystem jobs (management)",
        "description": "List the caller's ecosystem jobs, newest first. Requires a user JWT. Optional ?status= filter and ?limit= cap (default 50, max 200).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "claimed",
                "succeeded",
                "dead"
              ]
            },
            "description": "Filter to a specific job lifecycle status; absent = all statuses"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Max rows to return; default 50, capped at 200"
          }
        ],
        "responses": {
          "200": {
            "description": "Ecosystem jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jobs"
                  ],
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiProcessingJob"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/webhooks": {
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Register a webhook endpoint",
        "description": "Register a new outbound webhook target. The signing secret (`secret`) is returned exactly once in the response — store it; it cannot be retrieved again. The URL must be https:// and resolve to a publicly routable address (SSRF guard).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "eventTypes"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "HTTPS delivery target. Private/loopback/link-local URLs are rejected."
                  },
                  "eventTypes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Event types to subscribe to (e.g. [\"job.succeeded\", \"job.failed\"])"
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional human-readable label"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webhook endpoint created (secret shown once)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingWebhookEndpointCreated"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "List webhook endpoints (secret redacted)",
        "description": "List active (non-deleted) webhook endpoints for the caller's ecosystem. The `secret` field is never included in list responses.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "endpoints"
                  ],
                  "properties": {
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiProcessingWebhookEndpoint"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/webhooks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "processing"
        ],
        "summary": "Update a webhook endpoint (active / eventTypes)",
        "description": "Toggle `active` or replace `eventTypes`. The URL and secret are immutable after creation. Returns 404 when not found or owned by another ecosystem.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "active": {
                    "type": "boolean",
                    "description": "Enable or disable delivery"
                  },
                  "eventTypes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replace the subscribed event-type list"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated endpoint (secret redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingWebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "processing"
        ],
        "summary": "Soft-delete a webhook endpoint",
        "description": "Marks the endpoint as deleted (sets `deleted_at`). The row is preserved for audit but hidden from future list results and excluded from deliveries. Returns 404 when not found, already deleted, or owned by another ecosystem.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Endpoint soft-deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/webhooks/{id}/deliveries": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "List delivery attempts for a webhook endpoint",
        "description": "Returns up to 200 delivery-attempt rows for the endpoint, newest first. Returns 404 when the endpoint is not found, soft-deleted, or belongs to another ecosystem.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery attempts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deliveries"
                  ],
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiProcessingWebhookDelivery"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/nodes/register": {
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Register or refresh an AI node (worker)",
        "description": "A node announces itself at start and every 60 s. Upserts the registry row keyed on the node's stable id. A `config` carrying a credential-looking key is refused (400): the registry holds no secret.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "kind",
                  "version",
                  "host",
                  "providers",
                  "config"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "Stable node id"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "typescript",
                      "swift"
                    ]
                  },
                  "version": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "host": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "providers": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "$ref": "#/components/schemas/AiProcessingProviderKind"
                    }
                  },
                  "config": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Non-secret configuration the node reports; at most 8 KB serialized"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Node registered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "logRetentionDays"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "logRetentionDays": {
                      "type": "integer",
                      "description": "How long the node logs live"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/nodes/{id}/logs": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Ship a batch of node log entries (worker)",
        "description": "At most 200 entries; a structurally invalid entry rejects the batch (400). The node must be registered (404 otherwise). `message` is at most 4096 bytes of UTF-8. An entry whose `data` is over 8 KB serialized or contains a credential-looking key is dropped alone and counted in the response `dropped`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "entries"
                ],
                "properties": {
                  "entries": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 200,
                    "items": {
                      "type": "object",
                      "required": [
                        "occurredAt",
                        "level",
                        "event",
                        "message"
                      ],
                      "properties": {
                        "occurredAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "level": {
                          "$ref": "#/components/schemas/AiProcessingLogLevel"
                        },
                        "event": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "message": {
                          "type": "string",
                          "description": "At most 4096 bytes of UTF-8"
                        },
                        "jobId": {
                          "type": "string",
                          "maxLength": 36
                        },
                        "data": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Logs accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accepted",
                    "dropped"
                  ],
                  "properties": {
                    "accepted": {
                      "type": "integer"
                    },
                    "dropped": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/config-sets": {
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "List LLM config sets (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Config sets, by name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "configSets"
                  ],
                  "properties": {
                    "configSets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiProcessingConfigSet"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Create an LLM config set (admin)",
        "description": "A set names a personas service plus a model, or no service = the node local LLM. A paid service may sit on any host its kind speaks — an OpenAI-compatible service (Groq, Cerebras, Fireworks, Together, …) is kind openai with its own base URL. A service whose kind no node can run, or a model the service does not offer, is 400; a duplicate name is 409.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiProcessingConfigSetInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Config set created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingConfigSet"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/config-sets/default": {
      "delete": {
        "tags": [
          "processing"
        ],
        "summary": "Clear the default config set (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Default cleared"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/config-sets/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "Read a config set (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Config set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingConfigSet"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "processing"
        ],
        "summary": "Replace a config set (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiProcessingConfigSetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Config set updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingConfigSet"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "processing"
        ],
        "summary": "Delete a config set (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/config-sets/{id}/default": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Make a config set the default (admin)",
        "description": "Jobs that name no set run under the default. Clears the previous default.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The new default config set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingConfigSet"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/nodes": {
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "List registered AI nodes (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Nodes, by id",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "nodes"
                  ],
                  "properties": {
                    "nodes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiProcessingNode"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/nodes/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "Read a registered AI node (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Node",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingNode"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "processing"
        ],
        "summary": "Delete a node registry row (admin)",
        "description": "Removes the registry row only: its logs age out with retention, and a live node re-registers.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/worker-tokens": {
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "List AI node worker tokens (admin)",
        "description": "Metadata only; the raw value is shown once, on create.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Worker tokens, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "workerTokens"
                  ],
                  "properties": {
                    "workerTokens": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiProcessingWorkerToken"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "processing"
        ],
        "summary": "Mint an AI node worker token (admin)",
        "description": "A token scoped ai-processing:worker, for a node to set as AI_NODE_API_TOKEN. The raw value is in `token` and is returned only here.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiProcessingWorkerTokenInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Worker token created",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/AiProcessingWorkerToken"
                    },
                    {
                      "type": "object",
                      "required": [
                        "token"
                      ],
                      "properties": {
                        "token": {
                          "type": "string",
                          "description": "The raw token, shown once"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/worker-tokens/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "processing"
        ],
        "summary": "Revoke an AI node worker token (admin)",
        "description": "A node still using it gets 401 on its next call.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/nodes/{id}/logs": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "List one node's logs, newest first (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "level",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AiProcessingLogLevel"
            },
            "description": "Minimum level: this level and above"
          },
          {
            "name": "jobId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only entries for this job"
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Only entries with an id below this (the previous page `nextBefore`)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            },
            "description": "Max entries; default 100, capped at 500"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of log entries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingNodeLogPage"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/logs": {
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "List logs across all nodes, newest first (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "level",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AiProcessingLogLevel"
            },
            "description": "Minimum level: this level and above"
          },
          {
            "name": "jobId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only entries for this job"
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Only entries with an id below this (the previous page `nextBefore`)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            },
            "description": "Max entries; default 100, capped at 500"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of log entries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingNodeLogPage"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/admin/settings": {
      "get": {
        "tags": [
          "processing"
        ],
        "summary": "Read AI processing settings (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingSettings"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "processing"
        ],
        "summary": "Update AI processing settings (admin)",
        "description": "Sets the node log retention window (server-bag ai_processing.node_log_retention_days).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiProcessingSettings"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Settings saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiProcessingSettings"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/applications/{appId}/schema-grants": {
      "parameters": [
        {
          "name": "appId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Get an application’s schema permissions (per bucket + per table CRUD)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The application’s schema grants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "grants"
                  ],
                  "properties": {
                    "grants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "schemaId",
                          "crud",
                          "tables"
                        ],
                        "properties": {
                          "schemaId": {
                            "type": "string",
                            "description": "the bucket id the grant is for"
                          },
                          "crud": {
                            "type": "string",
                            "pattern": "^$|^[CRUD](,[CRUD])*$"
                          },
                          "tables": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "tableId",
                                "crud"
                              ],
                              "properties": {
                                "tableId": {
                                  "type": "string"
                                },
                                "crud": {
                                  "type": "string",
                                  "pattern": "^$|^[CRUD](,[CRUD])*$"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Reconcile an application’s schema permissions",
        "description": "Persists the app’s grants as per-app bucket access-groups. Buckets must belong to the app’s ecosystem (404 otherwise); each table must belong to its bucket.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "grants"
                ],
                "properties": {
                  "grants": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "schemaId",
                        "crud",
                        "tables"
                      ],
                      "properties": {
                        "schemaId": {
                          "type": "string",
                          "description": "the bucket id the grant is for"
                        },
                        "crud": {
                          "type": "string",
                          "pattern": "^$|^[CRUD](,[CRUD])*$"
                        },
                        "tables": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "tableId",
                              "crud"
                            ],
                            "properties": {
                              "tableId": {
                                "type": "string"
                              },
                              "crud": {
                                "type": "string",
                                "pattern": "^$|^[CRUD](,[CRUD])*$"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "reconciled"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tokens": {
      "get": {
        "tags": [
          "tokens"
        ],
        "summary": "List the caller’s token principals (metadata only; secret never returned)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Narrow to tokens bound to this ecosystem (rdid or uuid; must be manageable by the caller) — the per-product Tokens view"
          },
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Scope every op to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own tokens. Unknown/foreign slug: 404."
          }
        ],
        "responses": {
          "200": {
            "description": "Token principals",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TokenPrincipal"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "tokens"
        ],
        "summary": "Mint a token principal (raw `adh_…` secret shown once)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Scope every op to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own tokens. Unknown/foreign slug: 404."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "nullable": true
                  },
                  "ecosystemId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "The ecosystem (rdid or uuid; must be manageable by the caller) the token — and its isolated bucket — binds to. Omitted: the owner’s own ecosystem."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Token principal + raw secret (shown once)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPrincipalCreated"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tokens/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "tokens"
        ],
        "summary": "Revoke a token principal (also tears down its bucket)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Scope every op to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own tokens. Unknown/foreign slug: 404."
          }
        ],
        "responses": {
          "204": {
            "description": "revoked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integrations": {
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "List a target ecosystem's connections (secrets redacted)",
        "description": "Returns every integration connection OWNED by the target ecosystem `ecosystemId` (the caller must manage it). Secret columns are never included. 400 when `ecosystemId` is omitted; 404/403 when the ecosystem is unknown / not the caller's.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connections"
                  ],
                  "properties": {
                    "connections": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IntegrationConnection"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/end-user-connections": {
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Health of an ecosystem's end-user connections (operator)",
        "description": "Provider, service type, status, last sync and last error for each END-USER connection in the ecosystem. No account name, username, external id or connection id: an operator can see that a connection is unhealthy, not whose it is. The caller must manage the ecosystem (400 when `ecosystemId` is omitted; 404/403 when unknown / not the caller's).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "End-user connection health",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connections"
                  ],
                  "properties": {
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "provider",
                          "serviceType",
                          "status",
                          "lastSyncAt",
                          "lastError"
                        ],
                        "properties": {
                          "provider": {
                            "type": "string"
                          },
                          "serviceType": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "description": "active | error | revoked | pending"
                          },
                          "lastSyncAt": {
                            "type": "string",
                            "nullable": true
                          },
                          "lastError": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/{connectionId}/data/{resource}": {
      "parameters": [
        {
          "name": "connectionId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "resource",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "media-items | social-notifications | media-albums | email-labels | social-posts"
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Read a connection's synced rows (Data tab)",
        "description": "One page of live rows, ordered by `syncVersion`. Only the connection's own customer may read; any other caller, an end-user connection and a deleted connection all get the same 404. Unknown `resource` is 404; a bad `cursor` or `limit` is 400. `limit` defaults to 50 and is capped at 200.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rows",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationConnectionDataPage"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/media-content/{token}": {
      "parameters": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Signed token from the media content URL route"
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Fetch a Google Photos image by signed URL (public)",
        "description": "No bearer: an `<img>` cannot send one. The token is the credential. It names one connection, one media item and one size, and expires after five minutes. Returns the image bytes with the upstream content type. Errors are opaque: 401 for a bad, expired or forged token, 404 for an unknown item, 502 when the image could not be fetched, 504 when the fetch timed out.",
        "responses": {
          "200": {
            "description": "Image bytes",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "504": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/providers": {
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "List providers the end user can connect",
        "description": "Catalog entries marked end-user connectable AND enabled in the caller's ecosystem. Public fields only.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Providers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "providers"
                  ],
                  "properties": {
                    "providers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IntegrationMeProvider"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/providers/{providerId}/auth-url": {
      "parameters": [
        {
          "name": "providerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Get the OAuth authorize URL (end user)",
        "description": "oauth providers only (400 otherwise). 404 when the provider is not connectable in the caller's ecosystem. `serviceType` must be one the provider offers (400 otherwise).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "redirectUri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serviceType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorize URL + round-trip state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url",
                    "state"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/providers/{providerId}/register-instance": {
      "parameters": [
        {
          "name": "providerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Register a self-hosted OAuth instance (end user)",
        "description": "oauth_instance providers only (400 otherwise). The body is strict: `ecosystemId` and `providerConfigId` are refused. `serviceType` must be one the provider offers (400 otherwise).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "instanceUrl",
                  "redirectUri"
                ],
                "additionalProperties": false,
                "properties": {
                  "instanceUrl": {
                    "type": "string"
                  },
                  "redirectUri": {
                    "type": "string"
                  },
                  "serviceType": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Instance registration -> authorize URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "state",
                    "authorizeUrl",
                    "clientId"
                  ],
                  "properties": {
                    "state": {
                      "type": "string"
                    },
                    "authorizeUrl": {
                      "type": "string"
                    },
                    "clientId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connect": {
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Connect an integration (end user)",
        "description": "Finishes the connect flow for the caller. Returns the redacted connection. 404 when the provider is not connectable in the caller's ecosystem. `serviceType` must be one the provider offers (400 otherwise).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationMeConnectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected (redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationConnection"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connections": {
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "List the caller's own connections",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connections"
                  ],
                  "properties": {
                    "connections": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IntegrationConnection"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connections/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "integrations"
        ],
        "summary": "Disconnect one of the caller's connections",
        "description": "Soft-deletes the connection and tombstones the rows it produced.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connections/{id}/sync": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Sync one of the caller's connections now",
        "description": "503 when no worker is registered for its provider and service type.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Sync dispatched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connections/{id}/settings": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "integrations"
        ],
        "summary": "Update sync settings on one of the caller's connections",
        "description": "Same settings and validation as PATCH /integrations/{connectionId}/settings. 400 on an invalid body.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated sync settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "syncSettings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "syncSettings": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connections/{id}/actions/{actionType}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "actionType",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Act as the user on one of their connections",
        "description": "Same actions and payloads as the operator route. Unlike it, the response carries the action's raw `result`. An optional `Idempotency-Key` header collapses a repeat onto the first row.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional client key; a repeat returns the first recorded result."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Action recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationMeActionResult"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connections/{id}/google-photos/picker-sessions": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Start a Google Photos Picker session",
        "description": "google-photos connections only. The hub keeps no session state; the id belongs to the client.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationPickerSessionStart"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connections/{id}/google-photos/picker-sessions/{sessionId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "sessionId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Check whether the user has finished picking",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Session state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationPickerSessionState"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connections/{id}/google-photos/uploads": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Upload photo bytes to Google Photos",
        "description": "The request body is the raw bytes. They are streamed to Google, never buffered, and capped at 200 MB (413). Run action `upload` with the returned token to create the media item. 504 when Google is too slow, 502 on a network failure.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upload token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uploadToken"
                  ],
                  "properties": {
                    "uploadToken": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "504": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/me/connections/{id}/media/{mediaItemId}/content": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "mediaItemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Get a five-minute signed URL for one photo at one size",
        "description": "Makes no Google call. The URL points at the public media-content route. 404 unless the connection is the caller's own google-photos one and the item is on it.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "w",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "h",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signed URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url",
                    "expiresAt"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/providers": {
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "List the provider catalog",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Provider catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "providers"
                  ],
                  "properties": {
                    "providers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IntegrationProvider"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/providers/{providerId}/auth-url": {
      "parameters": [
        {
          "name": "providerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Get the OAuth authorize URL for a provider",
        "description": "Only valid for oauth providers (400 otherwise). 404 for an unknown provider. The authorize URL uses the target ecosystem `ecosystemId`'s client id; the caller must manage it (400 when omitted; 404/403 when unknown / not the caller's).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirectUri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serviceType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scopes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorize URL + round-trip state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url",
                    "state"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/providers/{providerId}/install-url": {
      "parameters": [
        {
          "name": "providerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Get the app-installation URL for a provider",
        "description": "Only valid for github_app providers (400 otherwise). 404 for an unknown provider. The URL points at the provider's own installation page, where the installer picks the account and the repositories; the app returns to the setup URL configured on the app itself, so no redirectUri is taken. The caller must manage the target ecosystem `ecosystemId` (400 when omitted; 404/403 when unknown / not the caller's).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serviceType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Installation URL + round-trip state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url",
                    "state"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/providers/{providerId}/link-token": {
      "parameters": [
        {
          "name": "providerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Mint a Plaid Link token",
        "description": "Only valid for plaid_link providers (400 otherwise). 404 for an unknown provider. The link token is minted for the target ecosystem `ecosystemId`; the caller must manage it (404/403 when unknown / not the caller's).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ecosystemId"
                ],
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "description": "Target ecosystem id (the caller must manage it)"
                  },
                  "serviceType": {
                    "type": "string",
                    "description": "Defaults to the provider primary service type"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Plaid link token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "linkToken"
                  ],
                  "properties": {
                    "linkToken": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/providers/{providerId}/register-instance": {
      "parameters": [
        {
          "name": "providerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Register a self-hosted OAuth instance (Mastodon)",
        "description": "Only valid for oauth_instance providers (400 otherwise). 404 for an unknown provider. The instance is registered under the target ecosystem `ecosystemId`; the caller must manage it (404/403 when unknown / not the caller's).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ecosystemId",
                  "instanceUrl",
                  "redirectUri"
                ],
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "description": "Target ecosystem id (the caller must manage it)"
                  },
                  "instanceUrl": {
                    "type": "string"
                  },
                  "redirectUri": {
                    "type": "string"
                  },
                  "serviceType": {
                    "type": "string"
                  },
                  "providerConfigId": {
                    "type": "string",
                    "description": "When set, per-instance clientId/clientSecret/instanceUrl come from this ecosystem provider-config (not a dynamic registration) and the connection links it."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Instance registration → authorize URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "state",
                    "authorizeUrl",
                    "clientId"
                  ],
                  "properties": {
                    "state": {
                      "type": "string"
                    },
                    "authorizeUrl": {
                      "type": "string"
                    },
                    "clientId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/providers/{providerId}/adopt-installations": {
      "parameters": [
        {
          "name": "providerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Connect every installation the saved GitHub App can already see",
        "description": "This is what lets ADDING the integration BE the connect. A GitHub App is installed on github.com, by a person choosing an account there — so by the time an app id and private key are saved, that choice has already been made and the app can read it back. An OAuth redirect at this point would ask a question whose answer is already known.\n\nOnly valid for github_app providers (400 otherwise); 404 for an unknown provider or an unknown config. `providerConfigId` is REQUIRED and read by id, never resolved: the resolver falls back to the platform-global app when an ecosystem has none of its own, and enumerating a shared app's installations would list every other tenant's.\n\nONE INSTALLATION'S FAILURE IS NOT THE BATCH'S. An app on four orgs, one of them suspended, connects three and reports the fourth under `skipped` with GitHub's message. Only a failure to enumerate at all — which is the credentials themselves being wrong — is a 400. Calling it again is safe: an installation already connected comes back under `connected` with its existing `connectionId`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ecosystemId",
                  "providerConfigId"
                ],
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "description": "Target ecosystem id (the caller must manage it)"
                  },
                  "providerConfigId": {
                    "type": "string",
                    "description": "The saved config holding the app id and private key. See above for why it cannot be omitted."
                  },
                  "serviceType": {
                    "type": "string",
                    "description": "Defaults to the provider's primary service type."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What became of each installation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connected",
                    "skipped"
                  ],
                  "properties": {
                    "connected": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "installationId",
                          "accountLogin",
                          "targetType"
                        ],
                        "properties": {
                          "installationId": {
                            "type": "string"
                          },
                          "accountLogin": {
                            "type": "string",
                            "description": "The account the app is installed on — the org whose repositories it reaches."
                          },
                          "targetType": {
                            "type": "string",
                            "description": "`Organization` or `User`."
                          },
                          "connectionId": {
                            "type": "string",
                            "description": "The connection holding it — set when this call made one, AND when a previous call already had. Adoption is idempotent, so a second call over the same installations reports them connected rather than connecting them again."
                          },
                          "skipped": {
                            "type": "string",
                            "description": "Why it was not connected. Absent on success."
                          },
                          "warning": {
                            "type": "string",
                            "description": "The connection stands, and the prefetch that rides along behind it — caching what this installation was granted — did not finish. NOT a skip: everything that needs a connection works, and only the repository picker opening instantly does not. It is reported because this call is what the Test button runs, and a picker that will open empty should say so now rather than at the moment somebody needs it."
                          }
                        }
                      }
                    },
                    "skipped": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "installationId",
                          "accountLogin",
                          "targetType"
                        ],
                        "properties": {
                          "installationId": {
                            "type": "string"
                          },
                          "accountLogin": {
                            "type": "string",
                            "description": "The account the app is installed on — the org whose repositories it reaches."
                          },
                          "targetType": {
                            "type": "string",
                            "description": "`Organization` or `User`."
                          },
                          "connectionId": {
                            "type": "string",
                            "description": "The connection holding it — set when this call made one, AND when a previous call already had. Adoption is idempotent, so a second call over the same installations reports them connected rather than connecting them again."
                          },
                          "skipped": {
                            "type": "string",
                            "description": "Why it was not connected. Absent on success."
                          },
                          "warning": {
                            "type": "string",
                            "description": "The connection stands, and the prefetch that rides along behind it — caching what this installation was granted — did not finish. NOT a skip: everything that needs a connection works, and only the repository picker opening instantly does not. It is reported because this call is what the Test button runs, and a picker that will open empty should say so now rather than at the moment somebody needs it."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/providers/{providerId}/test-credentials": {
      "parameters": [
        {
          "name": "providerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Test credentials that have NOT been saved",
        "description": "The Test button in an Add-integration dialog, where there is no row to address yet. WRITES NOTHING — no config, no connection, no cache — which is the whole difference between this and POST …/provider-configs/{configId}/test, where testing a GitHub App deliberately adopts as it verifies.\n\nSend the draft in whichever shape the provider takes: `clientId`/`clientSecret` for an OAuth or GitHub-App provider, `fields` for one with declared config fields. A field the provider does not declare is a 400, exactly as it would be on save.\n\nSECRETS ARE WRITE-ONLY, so the secret box of an EDIT dialog is blank on screen even though a credential is stored. Pass `providerConfigId` and a blank secret to test the stored one: without it the probe would present an empty secret and report a failure that says nothing about the integration being edited.\n\nA refused credential is 200 with `ok: false`. See IntegrationTestResult.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ecosystemId"
                ],
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "description": "The ecosystem the draft is being typed into (the caller must manage it)"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "OAuth client id, or a GitHub App id"
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "The secret being tried — a client secret, private key, or API token"
                  },
                  "fields": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "The provider's declared config fields, as on create/update"
                  },
                  "providerConfigId": {
                    "type": "string",
                    "description": "The saved config being edited. Its stored secret is used when the submitted one is blank. See above for why this cannot simply be omitted."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the provider said",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationTestResult"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/connect": {
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Connect an integration (polymorphic by auth method)",
        "description": "Finishes any auth method's connect flow and persists the connection under the target ecosystem `ecosystemId` the client names; the caller must manage it (404/403 otherwise). Returns the redacted connection (tokens never echoed).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationConnectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected (redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationConnection"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/{connectionId}": {
      "parameters": [
        {
          "name": "connectionId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "integrations"
        ],
        "summary": "Disconnect a connection (ecosystem-authorized)",
        "description": "Soft-deletes the connection and tombstones every synced-data row it produced. The owning ecosystem is derived from the connection; the caller must manage it. 404 when the connection is absent/deleted; 403 when the caller cannot manage its ecosystem.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/{connectionId}/sync": {
      "parameters": [
        {
          "name": "connectionId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Trigger an immediate sync (sync now)",
        "description": "Runs the connection's worker once, independent of the background scheduler. The owning ecosystem is derived from the connection; the caller must manage it. 404 when absent/deleted; 403 when the caller cannot manage its ecosystem; 503 when no worker is registered for its provider:serviceType (retryable once a worker ships).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Sync dispatched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/{connectionId}/actions/{actionType}": {
      "parameters": [
        {
          "name": "connectionId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "actionType",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Act as the user (outbound action)",
        "description": "Performs one outbound action (e.g. send an email, post a status) as the connection, and records exactly one action-log row. The provider is derived from the connection (never in the URL). 404 when not the caller's; 422 when no action handler is registered for its provider:actionType; 400 on an unknown actionType or invalid body. An optional `Idempotency-Key` header makes a repeat collapse onto the first row (no re-perform).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional client key; a repeat returns the first recorded result."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Action recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationActionResult"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/{connectionId}/settings": {
      "parameters": [
        {
          "name": "connectionId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "integrations"
        ],
        "summary": "Update per-connection sync settings",
        "description": "Ecosystem-authorized, validated write of the caller-tunable sync settings the sync worker reads (e.g. gmailLabelIds / gmailWindowDays / redditSubreddits / redditKeywords). The owning ecosystem is derived from the connection; the caller must manage it. 404 when absent/deleted; 403 when the caller cannot manage its ecosystem; 400 on an invalid body.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "gmailLabelIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Gmail label ids to sync (default INBOX)."
                  },
                  "gmailWindowDays": {
                    "type": "integer",
                    "description": "Days of history to sync (default 30, max 366)."
                  },
                  "redditSubreddits": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Subreddits to watch (name or r/name; max 50)."
                  },
                  "redditKeywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Keywords to match within watched subreddits (max 50)."
                  },
                  "audienceIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Provider audience/list ids to sync contacts for (default none — roster only)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated sync settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "syncSettings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "syncSettings": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/ecosystems/{ecosystemId}/provider-configs": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "List an ecosystem's provider configs (secrets masked)",
        "description": "Every stored provider config for the ecosystem, secrets masked to `hasSecret` (each carries its `name` + `rdid`). The ecosystemId must be the caller's own ecosystem (403 otherwise).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Masked provider configs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "configs"
                  ],
                  "properties": {
                    "configs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IntegrationProviderConfig"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Create a new named provider config for an ecosystem",
        "description": "Creates a NEW named provider-config instance and mints its `integration` rdid. rdid is the only uniqueness gate — a SECOND config for the same provider (different name) is allowed. OAuth providers send clientId/scopes/…/clientSecret; api_key providers send the spec-driven `fields` map (+ optional `enabled`); the route splits secret vs non-secret by auth method. 404 for an unknown provider. The ecosystemId must be the caller's own ecosystem (403 otherwise). Returns the masked row (incl. id + rdid + name).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "providerId",
                  "name"
                ],
                "description": "`providerId` + `name` identify the new instance; the remaining keys are the provider-specific config, validated by auth method.",
                "properties": {
                  "providerId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Human-facing instance name (drives the rdid leaf)"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "authUrl": {
                    "type": "string"
                  },
                  "tokenUrl": {
                    "type": "string"
                  },
                  "userinfoUrl": {
                    "type": "string"
                  },
                  "validateUrl": {
                    "type": "string"
                  },
                  "credentialStyle": {
                    "type": "string",
                    "enum": [
                      "form_body",
                      "basic_auth"
                    ]
                  },
                  "endpoints": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Encrypted at rest; never returned"
                  },
                  "fields": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "api_key providers: the provider's configFields keyed by field key (the one secret is split into the encrypted slot)."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "api_key providers: false pauses the provider without deleting its secret."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created (masked)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProviderConfig"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/ecosystems/{ecosystemId}/provider-configs/{configId}": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "configId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Get one of an ecosystem's provider configs (secret masked)",
        "description": "Addressed by the config uuid or its rdid. 404 when neither resolves within the ecosystem.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Masked provider config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProviderConfig"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integrations"
        ],
        "summary": "Update an ecosystem's provider config",
        "description": "Updates the config addressed by `configId`. OAuth providers REPLACE the non-secret config; api_key providers MERGE the submitted fields over the stored config. A blank/absent clientSecret preserves the stored encrypted secret, a present one is encrypted at rest; `name` renames the instance (the rdid is stable). The change invalidates the resolver cache so the ecosystem's new creds drive its flows immediately. 404 when the config is absent or not owned by the ecosystem (403 when the caller cannot manage the ecosystem).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "OAuth providers send clientId/scopes/…/clientSecret; api_key providers send the spec-driven `fields` map (+ optional `enabled`). `name` (optional) renames the instance. The route branches by the stored config's auth method.",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Rename the instance (the rdid stays stable)"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "authUrl": {
                    "type": "string"
                  },
                  "tokenUrl": {
                    "type": "string"
                  },
                  "userinfoUrl": {
                    "type": "string"
                  },
                  "validateUrl": {
                    "type": "string"
                  },
                  "credentialStyle": {
                    "type": "string",
                    "enum": [
                      "form_body",
                      "basic_auth"
                    ]
                  },
                  "endpoints": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Blank/absent preserves the existing secret"
                  },
                  "fields": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "api_key providers: the provider's configFields keyed by field key (the one secret is split into the encrypted slot; a blank/absent secret preserves the stored one)."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "api_key providers: false pauses the provider without deleting its secret."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Masked provider config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProviderConfig"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integrations"
        ],
        "summary": "Delete an ecosystem's provider config",
        "description": "Addressed by the config uuid or its rdid. 404 when absent or not owned by the ecosystem.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/ecosystems/{ecosystemId}/provider-configs/{configId}/rotate-webhook-secret": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "configId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Rotate a postmark config's inbound deliverability webhook secret",
        "description": "Mints a NEW per-config webhook secret and returns it on the config's `deliverabilityWebhook.secret`. The previous secret stops authenticating immediately, so any Postmark webhook still sending it starts failing until the operator pastes the new value — the same \"this breaks what is already deployed\" contract as POST /audience/lists/{listId}/rotate-key. Also the way a config created before the per-config secret existed gets its first one. 400 on a provider with no inbound webhook; 404 when the config is absent or not owned by the ecosystem.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Masked provider config carrying the NEW webhook secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProviderConfig"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/ecosystems/{ecosystemId}/provider-configs/{configId}/test": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "configId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Test a saved integration against its provider",
        "description": "One answer, for every provider that can be asked. No body.\n\nFOR A GITHUB APP THE TEST IS THE ADOPT. The only way to prove an app id and private key are real is to mint a JWT and enumerate the installations the app can see, and that enumeration is exactly what creates the connection rows and warms the repository cache. So pressing Test on a saved GitHub integration is also what makes its orgs appear in the repository picker — deliberate, and reported back under `adopted`.\n\nEvery other provider is probed READ-ONLY against the validation endpoint its template declares; a provider whose template declares none is a 400 naming that fact rather than a green tick it did not earn.\n\nA refused credential is 200 with `ok: false`. 404 when the config is absent or not owned by the ecosystem.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "What the provider said",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationTestResult"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/ecosystems/{ecosystemId}/provider-configs/{configId}/transfer": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "configId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Move an integration to another ecosystem",
        "description": "Moves the credential, the connections it minted, and their cached repository lists together, in one transaction — an operator taking their own integration from a personal workspace into an organization they also own, or the other way. Leaving the connections behind would hand the destination a credential it can see no accounts through.\n\nTHE CALLER MUST MANAGE BOTH ENDS: the source is authorized as on every other route here, and the destination is authorized before anything moves (404/403 from whichever end the caller does not manage). The generic ecosystem-move surface cannot do this — its CRUD policy excludes credential tables on purpose.\n\nThe `integration` rdid embeds the owning ecosystem, so it is re-minted at the destination and the old address stops resolving. 400 when the config is already in the destination; 404 when it is absent or not owned by the source; 409 when the destination already holds an integration of that name.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "targetEcosystemId"
                ],
                "properties": {
                  "targetEcosystemId": {
                    "type": "string",
                    "description": "Destination ecosystem — a uuid, an rdid or a slug, like any other here"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What moved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationTransferResult"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/admin/configs": {
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "List provider global configs (admin; secrets masked)",
        "description": "Paged by limit/offset (limit defaults to 50, capped at 100; offset defaults to 0). Returns a pagination envelope: `items` is the page; `total` is the unfiltered provider-config count; `limit`/`offset` echo the applied paging.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Masked provider configs (paginated)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "limit",
                    "offset"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IntegrationGlobalConfig"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "description": "Unfiltered count of provider configs"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/admin/configs/{providerId}": {
      "parameters": [
        {
          "name": "providerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Get one provider global config (admin; secret masked)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Masked provider config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationGlobalConfig"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integrations"
        ],
        "summary": "Upsert a provider global config (admin)",
        "description": "Merges the non-secret config; a blank/absent clientSecret preserves the stored encrypted secret, a present one is encrypted at rest.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clientId": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "authUrl": {
                    "type": "string"
                  },
                  "tokenUrl": {
                    "type": "string"
                  },
                  "userinfoUrl": {
                    "type": "string"
                  },
                  "validateUrl": {
                    "type": "string"
                  },
                  "credentialStyle": {
                    "type": "string",
                    "enum": [
                      "form_body",
                      "basic_auth"
                    ]
                  },
                  "endpoints": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Blank/absent preserves the existing secret"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Masked provider config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationGlobalConfig"
                }
              }
            }
          },
          "400": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integrations"
        ],
        "summary": "Delete a provider global config (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Problem Details (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/invitations": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "Request to join an ecosystem (unauthenticated). Optionally addressed by ecosystem rdid/uuid; defaults to the hub.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicInvitationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/invitations/verify": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "Complete an invite-backed account by verifying its email link.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteVerifyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified + joined",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteVerifyResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/invitations/preview": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Preview an invitation by token (state + masked destination + ecosystem name).",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invitation preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitePreview"
                }
              }
            }
          }
        }
      }
    },
    "/auth/invitations/accept": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "A logged-in user accepts an invitation by token.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteAcceptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted or verification required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteAcceptResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/ecosystems/{ecosystemId}/invitation-requests": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List an ecosystem’s join requests (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invitation requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationRequest"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/ecosystems/{ecosystemId}/invitation-requests/{id}": {
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Delete an ecosystem join request (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/ecosystems/{ecosystemId}/pending-users": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List an ecosystem’s pending users (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pending users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingUser"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Add pending users to an ecosystem (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPendingUsersBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created pending users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingUser"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/ecosystems/{ecosystemId}/pending-users/{id}": {
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Delete a pending user from an ecosystem (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/ecosystems/{ecosystemId}/invitations": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List an ecosystem’s sent invitations (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invitations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invitation"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Send invitations (email/SMS) for an ecosystem (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInvitesBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sent invitations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invitation"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/ecosystems/{ecosystemId}/invitations/{id}": {
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Delete a sent invitation from an ecosystem (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/ecosystems/{ecosystemId}/admin-notes": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List a subject’s admin notes within an ecosystem (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subjectTable",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subjectId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Admin notes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AdminNote"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "auth"
        ],
        "summary": "Reconcile a subject’s admin notes within an ecosystem (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminNotesReconcileBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/ecosystems/{ecosystemId}/entity-history": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List a subject’s entity history within an ecosystem (owner-scoped)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subjectTable",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subjectId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entity history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EntityHistoryEntry"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/invitation-requests": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List join requests, newest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Invitation requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationRequest"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/invitation-requests/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Delete a join request",
        "description": "Removes the request only. The pending user it produced is left alone.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/pending-users": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List pending users, newest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Pending users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingUser"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Add people to the pending list",
        "description": "Adds one or more people without inviting them — sending is a separate step (POST /auth/invitations). Each gets the next `userNumber` for the ecosystem.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPendingUsersBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created pending users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingUser"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/pending-users/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Delete a pending user",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/invitations": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List sent invitations, newest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Invitations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invitation"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Send invitations to pending users",
        "description": "One invitation per person per requested channel that they have a destination for — so naming three people with both `email` and `sms` returns up to six rows. Every id is checked before anything is sent: one unknown id fails the whole call with 404.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInvitesBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The invitations that were sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invitation"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/invitations/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Delete a sent invitation",
        "description": "Deletes the record. It does not revoke a token already in someone’s inbox.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/announcements": {
      "get": {
        "tags": [
          "announcements"
        ],
        "summary": "List the ecosystem's announcements, newest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Announcements with their delivery counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "announcements"
        ],
        "summary": "Compose and send an announcement",
        "description": "Accepted, not completed: the response is 202 and delivery runs in the background. Poll the announcement to watch `sentCount` climb and `sentAt` appear. A delivery failure therefore never surfaces here.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnnouncementCreate"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued for delivery",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/announcements/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "announcements"
        ],
        "summary": "Get one announcement and its delivery progress",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The announcement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Announcement"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/user-methods": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List user auth methods (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "auth methods",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuthUserMethod"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Create a user auth method (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "provider"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "provider": {
                    "type": "string",
                    "minLength": 1
                  },
                  "providerId": {
                    "type": "string",
                    "nullable": true
                  },
                  "credential": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "created auth method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthUserMethod"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/user-methods/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Get a user auth method (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "auth method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthUserMethod"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "auth"
        ],
        "summary": "Update a user auth method (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "providerId": {
                    "type": "string"
                  },
                  "credential": {
                    "type": "string"
                  },
                  "clearCredential": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "updated auth method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthUserMethod"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Delete a user auth method (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/methods": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List auth method settings (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "auth method settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuthMethodSetting"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Create an auth method setting (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "method"
                ],
                "properties": {
                  "method": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "enabled": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "created setting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthMethodSetting"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/methods/{method}": {
      "parameters": [
        {
          "name": "method",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Get an auth method setting (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "auth method setting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthMethodSetting"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "auth"
        ],
        "summary": "Enable or disable an auth method setting, upserting it (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "upserted setting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthMethodSetting"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Delete an auth method setting (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/my-methods": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "List the caller's own auth methods",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "auth methods",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuthUserMethod"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/my-methods/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Remove one of the caller's own auth methods (keeping at least one)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/link-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Set or replace the caller's email/password credential",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "password"
                ],
                "properties": {
                  "password": {
                    "type": "string",
                    "minLength": 8
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "linked"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/link-provider": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Link a verified OAuth provider identity to the caller",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clientSlug",
                  "providerSlug"
                ],
                "properties": {
                  "clientSlug": {
                    "type": "string"
                  },
                  "providerSlug": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "accessToken": {
                    "type": "string"
                  },
                  "idToken": {
                    "type": "string"
                  },
                  "redirectUri": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "linked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "linked",
                    "provider"
                  ],
                  "properties": {
                    "linked": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/signup-lists/{publicKey}": {
      "parameters": [
        {
          "name": "publicKey",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "audience"
        ],
        "summary": "A signup list's public display config plus a fresh submit nonce",
        "responses": {
          "200": {
            "description": "The list as the embedded form renders it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupListPublic"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/signup-lists/{publicKey}/signups": {
      "parameters": [
        {
          "name": "publicKey",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "audience"
        ],
        "summary": "Join a signup list (unauthenticated; nonce + honeypot + per-IP cap)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "nonce"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 320
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "nonce": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "sourceUrl": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Honeypot. The real form renders it hidden and never fills it — any value means a bot. Documented because a client that omits it entirely is fine, and one that FILLS it is silently accepted-and-discarded rather than rejected."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/webhooks/postmark/{ecosystemId}": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The ecosystem whose webhook secret authenticates this call"
        }
      ],
      "post": {
        "tags": [
          "audience"
        ],
        "summary": "Deliverability events from Postmark (per-ecosystem secret header, not a JWT)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostmarkDeliverabilityEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/lists/{listId}/members": {
      "parameters": [
        {
          "name": "listId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "audience"
        ],
        "summary": "List members of a signup list, with delivery status",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Members",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListMember"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/lists/{listId}/members/{contactId}": {
      "parameters": [
        {
          "name": "listId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "contactId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "audience"
        ],
        "summary": "Remove a contact from a list",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/lists/{listId}/stats": {
      "parameters": [
        {
          "name": "listId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "audience"
        ],
        "summary": "Subscriber counts for a list",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Stats",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListStats"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/lists/{listId}/campaigns": {
      "parameters": [
        {
          "name": "listId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "audience"
        ],
        "summary": "A list's campaigns",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Campaigns",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Campaign"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "audience"
        ],
        "summary": "Create a draft campaign for this list",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created campaign",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/campaigns/{campaignId}": {
      "parameters": [
        {
          "name": "campaignId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "audience"
        ],
        "summary": "Edit a draft campaign",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "audience"
        ],
        "summary": "Delete a draft campaign",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/campaigns/{campaignId}/deliveries": {
      "parameters": [
        {
          "name": "campaignId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "audience"
        ],
        "summary": "A campaign's per-recipient send status",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Delivery"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/campaigns/{campaignId}/test-send": {
      "parameters": [
        {
          "name": "campaignId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "audience"
        ],
        "summary": "Send one preview copy to an address of the caller's choosing",
        "description": "The one endpoint in this feature that sends email synchronously, inside the request — an author-only, single-recipient preview that never touches the bulk queue. Never reachable by an acting (agent-on-behalf-of) principal. 409 when no email provider is connected, or when the address is a suppressed contact (bounced/complained/suppressed) — suppression applies to previews exactly as it does to a real send. 502 when the provider itself rejects the message.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestSendBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/campaigns/{campaignId}/send": {
      "parameters": [
        {
          "name": "campaignId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "audience"
        ],
        "summary": "Queue a campaign's deliveries for the background drain to send",
        "description": "Materializes one audience.deliveries row per mailable, subscribed member and leaves the actual send to the background drain (never sent inline). Never reachable by an acting (agent-on-behalf-of) principal.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Fan-out result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/lists/{listId}/invite": {
      "parameters": [
        {
          "name": "listId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "audience"
        ],
        "summary": "Convert a list's subscribed, mailable members into pending signup invites",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Invite result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/lists/{listId}/rotate-key": {
      "parameters": [
        {
          "name": "listId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "audience"
        ],
        "summary": "Rotate a list's public embed key",
        "description": "The old key stops accepting signups immediately; any embedded page using it must be updated.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "New key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateKeyResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/context": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "What a billing UI needs before it can draw a control",
        "description": "The one billing route that is NOT behind `requireBillingOperator`, and deliberately so: that gate answers 404 when the ecosystem’s `billing` flag is off — which is precisely the state an operator is trying to leave — so every other route here is invisible to the person who has to turn it on.\n\nIt leaks nothing that gate protects. `ecosystemId` is the caller’s own acting scope, which their token already carries; the rest are facts ABOUT that scope, not rows from it. A non-owner gets `canManage: false` and a UI with no controls, rather than a 404 that would read as a claim about the product rather than about the reader.\n\n`ecosystemId` comes from `actingIdentity(principal)` and is by construction the same id `/billing/accounts`, `/billing/prices`, `/billing/events` and the redrive scope to. A browser cannot derive it, which is why this route exists at all.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The acting ecosystem’s billing context",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingContext"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/accounts": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "The ecosystem’s payer accounts, newest first",
        "description": "Scoped to the acting identity’s ecosystem and to `deleted_at IS NULL`, ordered by `createdAt` descending and capped at 500 rows. There is no pagination and no filter: this is an operator’s payer list, not a reporting API. `claimTokenHash` is never selected — it is the receipt half of a credential, and a list endpoint is the last place it should be reachable from.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Up to 500 accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BillingAccount"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/accounts/{id}/resend-claim": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The `billing.accounts` row to re-issue a claim link for"
        }
      ],
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Mint a fresh claim token for one account and mail it again",
        "description": "It MINTS rather than resends: the stored value is a one-way hash, so the original token is unrecoverable and there is nothing to re-send. A fresh token restarts the claim TTL — which is what an expired link needs — and invalidates the previous one by overwriting the hash, which is what an operator who suspects the first link leaked wants. Delivery happens after the transaction commits and cannot fail the call: the mailer never throws and logs every path that does not send, so a second failure is visible in the logs and this route can simply be called again. A 200 therefore means \"a new token exists\", not \"the payer received it\".",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A new claim token was minted and delivery attempted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingResendClaim"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/prices": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Active prices on the ecosystem’s connected Stripe account",
        "description": "The list the offer editor picks a `stripe_price_id` from. Active prices only, with their product expanded, walked to a hard cap of 1000 — high enough that no plausible catalog of things an operator SELLS reaches it, low enough that one HTTP request cannot turn into an unbounded series of round-trips against a third party. Nothing is cached or stored: adh configures the OFFER, Stripe owns the money.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The active price catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BillingPriceOption"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/events": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "The webhook ledger, newest first",
        "description": "The receipt log the redrive below operates on: did the event arrive, and did it process. A row with `processedAt: null` beside an `error` is the surface this route exists for — without it a purchase that never landed is only visible in the database.\n\nThe stored payload is NOT returned. It is Stripe’s event body verbatim, and an operator’s ledger is not a place to re-publish a third party’s customer data; what this returns is the six fields that answer the question.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Up to `limit` events, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BillingEvent"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/events/redrive": {
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Re-apply stored Stripe events the receiver could not apply",
        "description": "The receiver STORES every verified event before it tries to apply it, so an event that arrived before its offer existed — or that hit a transient failure — is still on disk. This re-applies a batch of 100 in `receivedAt` order and reports what happened to each. `nextOffset` is the cursor: it is non-null exactly when the batch came back full, and passing it as `offset` is what makes the second call a DIFFERENT batch. Without it the fixed limit was not pagination at all — a row the redrive examines but cannot advance stays in the first hundred forever, and everything behind it was unreachable through this API.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "includeProcessed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What the batch did",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingRedriveResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/claim": {
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Redeem a claim token, binding a paid account to the caller",
        "description": "Authenticated, and on the billing base rather than `/public`, because redeeming BINDS an adh identity to a paid account and there is nothing to bind without a session — a claim route mounted on `/public` would read the principal as undefined on every request and refuse every claim. The page that collects the token is the public half and lives in the frontend; it posts here once the visitor is signed in. A delegated (acting) principal is refused outright: delegation means \"act on their behalf\", and irreversibly claiming ownership of something they paid for is not that.\n\nIDEMPOTENT FOR THE CLAIMANT, single-use for everyone else. A repeat presentation by the identity that already claimed it returns the same body as the first call, so a prefetching mail client or a retried POST does not tell the payer their link is invalid; a DIFFERENT identity presenting the same token still gets the 404.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BillingClaimRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The account this token was bound to",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingClaimResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/webhooks/stripe/{ecosystemId}": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The ecosystem whose Stripe webhook secret authenticates this call"
        }
      ],
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Stripe event receiver (HMAC over the raw body, not a JWT)",
        "description": "The only writer of `billing.accounts`. The signature is computed over the EXACT raw bytes, so the body is read as text and never re-serialized. Every stored secret for the ecosystem is tried in turn, which is what makes a secret rotation a non-event.\n\nIt STORES the event before it does anything that can fail, keyed uniquely on `(ecosystem_id, stripe_event_id)` — one Stripe account can serve two ecosystems under BYOK, so the Stripe event id alone is not a deduplication key. A replay of an already-stored event short-circuits to the same 200 without re-applying it.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StripeWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted (or already handled)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingAck"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/buckets/{bucketId}/types/{typeId}/rows": {
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "List rows of a bucket-type table (acting as an app/persona)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "bucketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rows",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketRowList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "bucket"
        ],
        "summary": "Create a bucket-type row (acting as an app/persona)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "bucketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BucketRow"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketRow"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/buckets/{bucketId}/types/{typeId}/rows/{rowId}": {
      "put": {
        "tags": [
          "bucket"
        ],
        "summary": "Update a bucket-type row (acting as an app/persona)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "bucketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BucketRow"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketRow"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "bucket"
        ],
        "summary": "Delete a bucket-type row (acting as an app/persona)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "bucketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted (soft or hard)"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/buckets/{bucketId}/access-groups": {
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "List access groups in a bucket",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "bucketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access groups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketAccessGroupList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "bucket"
        ],
        "summary": "Create an access group in a bucket",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "bucketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created access group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketAccessGroup"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/access-groups": {
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "List every access group the caller can see, across all buckets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Access groups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketAccessGroupList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/access-groups/{groupId}": {
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "Get an access group with its members + grants",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access group detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketAccessGroupDetail"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "bucket"
        ],
        "summary": "Rename / edit an access group",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one of name or description is required.",
                "minProperties": 1,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated access group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketAccessGroup"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "bucket"
        ],
        "summary": "Delete a custom access group (cascades members + grants)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/access-groups/{groupId}/members": {
      "post": {
        "tags": [
          "bucket"
        ],
        "summary": "Add a member (user/organization/persona/app/token) to an access group",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "memberType",
                  "memberId"
                ],
                "properties": {
                  "memberType": {
                    "type": "string",
                    "enum": [
                      "user",
                      "organization",
                      "persona",
                      "app",
                      "token"
                    ]
                  },
                  "memberId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketAccessGroupMember"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/access-groups/{groupId}/members/{memberId}": {
      "delete": {
        "tags": [
          "bucket"
        ],
        "summary": "Remove a member from an access group",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/access-groups/{groupId}/grants": {
      "put": {
        "tags": [
          "bucket"
        ],
        "summary": "Upsert a grant (bucket / bucket_type : crud) for an access group",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "targetType",
                  "targetId",
                  "crud"
                ],
                "properties": {
                  "targetType": {
                    "type": "string",
                    "enum": [
                      "bucket",
                      "bucket_type"
                    ]
                  },
                  "targetId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "crud": {
                    "type": "string",
                    "description": "comma-separated CRUD subset (or '' for none)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upserted grant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketGrant"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/access-groups/{groupId}/grants/{grantId}": {
      "delete": {
        "tags": [
          "bucket"
        ],
        "summary": "Remove a grant from an access group",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "grantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/tags": {
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "List the tags in every ecosystem the caller manages",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tags",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessTagList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "bucket"
        ],
        "summary": "Create a tag",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "ecosystemId": {
                    "type": "string",
                    "description": "the tag's ecosystem (rdid or uuid); defaults to the caller's"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created tag",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessTag"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/tags/{tagId}": {
      "delete": {
        "tags": [
          "bucket"
        ],
        "summary": "Delete a tag (removes it from every bucket type and row)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/buckets/{bucketId}/types/{typeId}/tags": {
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "List a tags-mode bucket type's tags",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "bucketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tags",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessTagList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "bucket"
        ],
        "summary": "Replace a tags-mode bucket type's tags",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "bucketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tagIds"
                ],
                "properties": {
                  "tagIds": {
                    "type": "array",
                    "maxItems": 256,
                    "items": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "description": "the complete set; each must be a tag in the bucket type's ecosystem"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The type now holds rows with these tags",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketTypeTagIds"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/tags/{tagId}/rows/{table}/{rowId}": {
      "put": {
        "tags": [
          "bucket"
        ],
        "summary": "Tag a row (idempotent)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "a taggable table, e.g. content.markdown"
          },
          {
            "name": "rowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tagged"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "bucket"
        ],
        "summary": "Remove a tag from a row",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "a taggable table, e.g. content.markdown"
          },
          {
            "name": "rowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Untagged"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/conversations": {
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "List the caller's chat conversations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Conversations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChatConversation"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Create a chat conversation",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatConversationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created conversation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatConversation"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/conversations/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "Get a conversation with its messages",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation + messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatConversationDetail"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "chat"
        ],
        "summary": "Rename a conversation",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatConversationRename"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Renamed"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "chat"
        ],
        "summary": "Soft-delete a conversation",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/conversations/{id}/messages": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Send a message and stream the assistant turn (SSE)",
        "description": "Sends a user message and streams the assistant response as Server-Sent Events (`text/event-stream`). The stream emits an `open` event, then `token`, `tool_call_started`, `tool_call_completed`, and a terminal `done` event; failures surface as an `error` event. The response is always 200 even when the conversation is missing or the turn fails — those conditions are reported in-band via the `error` event rather than an HTTP status.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatSendMessage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSE stream of chat-turn events",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ChatStreamEvent"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/conversations/{id}/messages/{mid}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "mid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "Get a single message",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatMessage"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "chat"
        ],
        "summary": "Edit a user message",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatMessageEdit"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Edited"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "chat"
        ],
        "summary": "Soft-delete a message",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/dms": {
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "List the caller's DM chats, newest activity first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Clamped server-side to at most 500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged DM chats",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmChatList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Open (or reuse) a DM chat with another user",
        "description": "Idempotent per user pair: 201 when a chat was created, 200 when one already existed. 403 when the recipient cannot be contacted (a block, or a privacy setting).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DmCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The existing chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmCreateResult"
                }
              }
            }
          },
          "201": {
            "description": "The newly created chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmCreateResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/dms/{chatId}/messages": {
      "parameters": [
        {
          "name": "chatId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "List the messages in a DM chat, oldest first",
        "description": "Paginates from the newest end — page 1 is the most recent window — but returns each page in ascending `seq` order. 404 (not 403) when the caller is not a participant, so a chat id cannot be probed for existence.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Clamped server-side to at most 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged DM messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmMessageList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Send a DM",
        "description": "Send a message into a DM chat. Supplying `clientMessageId` makes the send idempotent: a replay returns 200 with the already-stored message instead of 201. The id is scoped to the sender: one the OTHER participant already used in this chat is a 409.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DmSendMessage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The message a previous send with this clientMessageId stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmMessage"
                }
              }
            }
          },
          "201": {
            "description": "The stored message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmMessage"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/dms/{chatId}/read": {
      "parameters": [
        {
          "name": "chatId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Mark a DM chat read up to a message",
        "description": "Marks the chat read through `messageId`. Omit it — or name a message that is not this chat's — to mark the latest message read, which always leaves `unreadCount` 0.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DmReadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The recomputed unread count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmReadResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/dms/{chatId}/stream": {
      "parameters": [
        {
          "name": "chatId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "Stream new DMs in a chat (SSE)",
        "description": "Server-Sent Events (`text/event-stream`). Emits one `message` event per DM with `seq` greater than the `after` cursor — first the backlog, then each new message as it arrives. There is no `open`, `error`, or keepalive event, and no terminal event: the stream simply closes after at most 5 minutes, and the client reconnects with `after` set to the last `seq` it saw. Unlike the conversation turn stream, failures here are real HTTP statuses raised before the stream opens, never in-band.\n\nBecause a browser `EventSource` cannot set headers, this route (alone among the DM routes) also accepts the bearer token as an `access_token` query parameter.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Last `seq` already seen; only later messages are emitted. Defaults to 0.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "description": "The bearer token, for clients that cannot send an Authorization header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream of `message` events",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/DmMessage"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/stream": {
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "Stream live events across all of the caller's chats (SSE)",
        "description": "Server-Sent Events (`text/event-stream`), multiplexed over every chat the caller has joined — group chats, and DMs while the ecosystem's `messaging` flag is on. Each chat event is sent as `event: <kind>` with `data: {chatId, ...}`:\n\n- `message` / `message_updated` `{chatId, seq}` — a message landed / was edited.\n- `typing` `{chatId, participantId, state: start|stop, expiresAt}` — drop the indicator at `expiresAt` if no newer event arrives.\n- `chat_updated` `{chatId}` — the chat itself changed.\n- `participants_changed` `{chatId, added, removed}` — participant ids.\n- `resync` `{chatId}` — events may have been missed; refetch that chat.\n\nStream-level events: `ready` `{chatIds}` once the subscription is live (refetch after it — earlier changes were not streamed), and `chats_changed` `{added, removed}` when the caller joins or leaves a chat.\n\nIf the backend was started without a notification hub, the stream emits `ready` and closes immediately — poll instead. Otherwise it stays open for at most 5 minutes, with keep-alive comments, and closes with no terminal event; reconnect.\n\nBecause a browser `EventSource` cannot set headers, the bearer token may be passed as an `access_token` query parameter. Requires the `chat` feature.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "description": "The bearer token, for clients that cannot send an Authorization header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream of chat events",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ChatLiveEvent"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/definitions": {
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "List the chat definitions a new chat can be made from",
        "description": "The ecosystem's active definitions, plus the built-in `direct` definition (which DMs follow; a chat is never created from it here — open a DM through `/chat/dms`). Archived definitions are not listed: they accept no new chats.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Active definitions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatDefinitionList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/chats": {
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "List the caller's chats, newest activity first",
        "description": "Group chats, and DMs only while the ecosystem's `messaging` flag is on — every chat listed is one the caller can open.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Clamped server-side to at most 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged chats",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Create a chat from a definition",
        "description": "Seats the caller as owner, the definition's own personas, and the named users and personas. A definition persona that has since been deleted is skipped rather than refused — its id comes back in `skippedPersonaIds`. Refused: the `direct` definition (400 — use `/chat/dms`), an unknown or deleted definition, an unknown user, or an added persona the caller cannot use (404), an archived definition (409), a user blocked either way with the caller or another invited user (403), a `name` on a definition that is not user-configurable (403), more participants than the definition allows (400).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCreateResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/chats/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The chat id"
        }
      ],
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "Get a chat and the definition it follows",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatDetail"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "chat"
        ],
        "summary": "Change a chat's name or photo",
        "description": "Only on a definition that is user-configurable (403 otherwise). A change is published to the chat’s streams as `chat_updated`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/chats/{id}/participants": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The chat id"
        }
      ],
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Invite users and personas into a chat",
        "description": "Governed by the definition's `allowInvites`, `invitePolicy` and `allowAddedPersonas` (403), and its participant ceiling (409). Someone already seated is not added twice. A user blocked either way with anyone already in the chat, or with another invitee, is refused (403); an added persona the caller cannot use is 404. A definition persona that was deleted is skipped — its id comes back in `skippedPersonaIds`, as at create. Published as `participants_changed`, and `chats_changed` to each added user.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatParticipantsAddRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The chat and the rows added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatParticipantsAddResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/chats/{id}/participants/{participantId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The chat id"
        },
        {
          "name": "participantId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The participant ROW id (`ChatParticipant.id`)"
        }
      ],
      "delete": {
        "tags": [
          "chat"
        ],
        "summary": "Remove a participant from a chat, or leave it",
        "description": "Removing yourself is leaving; removing someone else is governed by the chat’s rules (403). When the owner leaves, the longest-standing user becomes owner (`newOwner`). A DM cannot be left (403). Published as `participants_changed`, and `chats_changed` to a removed user.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The chat after removal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatParticipantRemoveResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/chats/{id}/messages": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The chat id"
        }
      ],
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "List messages in a chat, ascending by seq",
        "description": "With `after`, the oldest `limit` messages whose `seq` is greater — the catch-up read a live client runs on a `message` event. Without it, the newest `limit` messages. Only user and assistant text is listed: a persona’s tool traffic is stored but never shown, previewed or counted unread.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Last `seq` already seen.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatMessageList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Send a message; the chat’s personas may reply (SSE)",
        "description": "WHO REPLIES follows the definition's `personaReplyPolicy`: `every_message` — every persona seated in the chat; `when_mentioned` — only the personas the body mentions. A MENTION is `@<persona slug>`, case-insensitive, standing as its own word (`ann@scout.dev` and `@scouting` do not mention `scout`; `(@scout)` and `@scout,` do). Mentions are recorded under either policy.\n\nWith nobody to reply (every DM, and a message no persona answers) this is a plain JSON send: 201 with the message, 200 for a `clientMessageId` replay (a replay never re-runs replies).\n\nWith personas to reply it answers `text/event-stream`: `open` `{message}` (the sent message, committed), then per persona in the order they joined: `persona_start` `{participantId, personaId}`; the turn’s own events (`token`, `tool_call_started`, `tool_call_completed`, `status`, `award`, `done`, `ended`), each with the persona’s `participantId` added; at most one `error` `{participantId, message}` if that persona could not reply; and `message` `{participantId, message}` for each visible row of its reply, once committed. The persona’s `typing` (kept alive for the whole turn, and stopped however it ends) and its messages are also published to the chat’s streams.\n\nEach persona’s turn is metered. The FIRST persona’s budget refusal (402) or unavailable metering (503) is returned before the message is stored; a later persona’s is its `error` event, and the personas after it still reply. The replies belong to the chat: they finish even if the sender disconnects.\n\nA persona sees the chat as a transcript: its own messages as its turns, everyone else’s as `Name: text` — including the replies of the personas before it.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DmSendMessage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The message a previous send with this clientMessageId stored (JSON), or the persona-reply stream (SSE)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmMessage"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ChatPersonaReplyEvent"
                }
              }
            }
          },
          "201": {
            "description": "The stored message; no persona replies",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmMessage"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/chats/{id}/read": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The chat id"
        }
      ],
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Mark a chat read up to a message",
        "description": "Marks the chat read through `messageId`. Omit it — or name a message that is not this chat's — to mark the latest message read.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DmReadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The recomputed unread count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DmReadResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat/chats/{id}/typing": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The chat id"
        }
      ],
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Report that the caller started or stopped typing",
        "description": "Published to the chat’s streams as `typing`, throttled server-side. An indicator lapses on its own at the event’s `expiresAt`. In a DM, 403 unless `messaging` is on and the sender may contact the peer.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatTypingRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Reported"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/communication-settings": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "The caller's communication/presence dial (saved row, or the open defaults)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The communication dial",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunicationSettings"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Replace the caller's communication/presence dial (upsert; full representation)",
        "description": "Masks must combine only the known AUDIENCE bits (PUBLIC=1, HUB=2, TEAM=4, ORG=8, FRIEND=32); 0 means nobody. Blocks always override the dial, and appear_offline hides presence from everyone.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "dmAudienceMask",
                  "presenceAudienceMask",
                  "appearOffline"
                ],
                "properties": {
                  "dmAudienceMask": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "AUDIENCE bitmask of who may DM the user (0 = nobody; default PUBLIC|HUB = 3)"
                  },
                  "presenceAudienceMask": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "AUDIENCE bitmask of who may see the user presence (0 = nobody; default PUBLIC|HUB = 3)"
                  },
                  "appearOffline": {
                    "type": "boolean",
                    "description": "When true, presence is hidden from EVERYONE regardless of the mask"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved communication dial",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunicationSettings"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/appearance": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "The caller's appearance preferences (empty object when never saved)",
        "description": "Every adh site reads this on sign-in so a user's colour mode and accessibility settings follow them across the family (the sites span many registrable domains, so a browser-local copy cannot). A signed-out visitor follows their OS setting instead.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The appearance preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppearanceSettings"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Replace the caller's appearance preferences (upsert; full representation)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "colorMode": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "light",
                      "dark"
                    ],
                    "description": "The user's colour scheme; 'auto' follows the operating system"
                  },
                  "reduceMotion": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "on",
                      "off"
                    ]
                  },
                  "contrast": {
                    "type": "string",
                    "enum": [
                      "default",
                      "high",
                      "extra-high"
                    ]
                  },
                  "textSize": {
                    "type": "string",
                    "enum": [
                      "default",
                      "small",
                      "large",
                      "extra-large"
                    ]
                  },
                  "spacing": {
                    "type": "string",
                    "enum": [
                      "compact",
                      "comfortable",
                      "spacious"
                    ]
                  },
                  "focusOutlines": {
                    "type": "boolean"
                  },
                  "underlineLinks": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved appearance preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppearanceSettings"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/workspace-prefs": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "The caller's chosen workspace (empty object when never chosen)",
        "description": "Every adh site's /home reads this so the workspace a user is working in follows them across the family (the sites span many registrable domains, so a browser-local copy cannot). A signed-out visitor never reaches /home at all.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace preference",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspacePrefs"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Replace the caller's workspace preference (upsert; full representation)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "description": "The workspace the user's /home chooser last landed on (a workspace slug)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved workspace preference",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspacePrefs"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/levels": {
      "get": {
        "tags": [
          "gamification"
        ],
        "summary": "The level ladder",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Levels",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GamificationLevel"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/badges": {
      "get": {
        "tags": [
          "gamification"
        ],
        "summary": "The global badge catalog",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Badge definitions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GamificationBadge"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/leaderboard": {
      "get": {
        "tags": [
          "gamification"
        ],
        "summary": "Ranked leaderboard by summed points for a subject kind",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "subjectType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "user"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "week",
                "month"
              ],
              "default": "all"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated leaderboard",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationLeaderboard"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/realms/{ecosystemId}/boards/{statKey}": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "statKey",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "gamification"
        ],
        "summary": "Per-realm leaderboard for one boardable stat (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "rolling30",
                "allTime",
                "trending",
                "season"
              ],
              "default": "trending"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked board (public persona entries)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationBoard"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/realms/{ecosystemId}/config": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "gamification"
        ],
        "summary": "Read a realm’s gamification config (admin) — defaults when unset",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Realm config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationRealmConfig"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "gamification"
        ],
        "summary": "Update a realm’s gamification config (admin, partial) — moving mode out of `none` triggers a retroactive replay, and entering `game` mode provisions the ecosystem’s game",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "none",
                      "gamification",
                      "game"
                    ]
                  },
                  "skin": {
                    "type": "string",
                    "enum": [
                      "rpg",
                      "plain"
                    ]
                  },
                  "surfaces": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "boolean"
                    }
                  },
                  "seasons": {
                    "$ref": "#/components/schemas/GamificationSeasons",
                    "description": "null clears seasons; an object sets the window (anchor + lengthDays 1..366)"
                  },
                  "timezone": {
                    "type": "string",
                    "description": "IANA zone for the realm's day/streak boundary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated config (with replay result when mode just left `none`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationRealmConfigUpdate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/realms/{ecosystemId}/catalog": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "gamification"
        ],
        "summary": "A realm’s effective catalog (admin) — defaults + realm overrides, source-tagged",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Effective catalog (badges + levels)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationCatalog"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/realms/{ecosystemId}/badges": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "gamification"
        ],
        "summary": "Author a realm badge (admin) — overrides the same (badgeLine, tier) default; POST /replay to backfill",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GamificationRealmBadgeInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The inserted realm badge row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationRealmBadge"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/realms/{ecosystemId}/badges/{id}": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "gamification"
        ],
        "summary": "Update a realm-owned badge (admin) — 404 for a platform default",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GamificationRealmBadgeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated realm badge row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationRealmBadge"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "gamification"
        ],
        "summary": "Delete a realm-owned badge (admin) — clears its holdings first; 404 for a default",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "string",
                      "description": "The deleted badge id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/realms/{ecosystemId}/levels": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "gamification"
        ],
        "summary": "Replace a realm’s level ladder (admin) — must start at 0 and be strictly increasing; POST /replay to backfill",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rungs"
                ],
                "properties": {
                  "rungs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "minPoints"
                      ],
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "minPoints": {
                          "type": "integer",
                          "minimum": 0
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The replaced ladder + replay hint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationRealmLevelsUpdate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/realms/{ecosystemId}/event-types": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "gamification"
        ],
        "summary": "List a realm’s custom event types (owner or admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Realm custom event types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GamificationRealmEventType"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "gamification"
        ],
        "summary": "Register a realm custom event type (owner or admin) — 409 on a duplicate name",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GamificationRealmEventTypeInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created event type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationRealmEventType"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/realms/{ecosystemId}/event-types/{id}": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "gamification"
        ],
        "summary": "Update a realm-owned custom event type (owner or admin) — 409 on a name collision",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GamificationRealmEventTypeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated event type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationRealmEventType"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "gamification"
        ],
        "summary": "Delete a realm-owned custom event type (owner or admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "string",
                      "description": "The deleted event type id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/realms/{ecosystemId}/events": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "gamification"
        ],
        "summary": "Ingest a realm custom event (owner or admin) — bumps the type’s stat and awards any newly-earned badges",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "subjectType",
                  "subjectId",
                  "dedupeKey"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A custom event type defined for this realm"
                  },
                  "subjectType": {
                    "type": "string"
                  },
                  "subjectId": {
                    "type": "string"
                  },
                  "dedupeKey": {
                    "type": "string",
                    "description": "Required idempotency key the caller owns (e.g. the source event id); the same key never double-counts"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deduped no-op (dedupeKey already seen)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationCustomEventResult"
                }
              }
            }
          },
          "201": {
            "description": "Ingested — stat bumped, badges evaluated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationCustomEventResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/subjects/{subjectType}/{subjectId}": {
      "parameters": [
        {
          "name": "subjectType",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "subjectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "gamification"
        ],
        "summary": "A subject’s gamification summary (points, level, badges, opt-out)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationSummary"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/subjects/{subjectType}/{subjectId}/points": {
      "parameters": [
        {
          "name": "subjectType",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "subjectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "gamification"
        ],
        "summary": "A subject’s point ledger (newest first)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated point ledger",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationPointsPage"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/subjects/{subjectType}/{subjectId}/preference": {
      "parameters": [
        {
          "name": "subjectType",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "subjectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "gamification"
        ],
        "summary": "Set a subject’s opt-out (self for a user, or admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "optedOut"
                ],
                "properties": {
                  "optedOut": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated preference",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationPreference"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/award": {
      "post": {
        "tags": [
          "gamification"
        ],
        "summary": "Award points to a subject (admin) — grants any newly-earned badges",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "subjectType",
                  "subjectId",
                  "amount",
                  "reason"
                ],
                "properties": {
                  "subjectType": {
                    "type": "string"
                  },
                  "subjectId": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "integer"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "sourceType": {
                    "type": "string"
                  },
                  "sourceId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Award result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationAwardResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gamification/replay": {
      "post": {
        "tags": [
          "gamification"
        ],
        "summary": "Retroactively backfill awards a subject’s telemetry already earned (admin) — `{ecosystemId}` replays the whole realm, `{subjectType, subjectId, ecosystemId}` replays one subject",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ecosystemId"
                ],
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "description": "The target realm to replay"
                  },
                  "subjectType": {
                    "type": "string",
                    "description": "With subjectId, replay just this one subject instead of the whole realm"
                  },
                  "subjectId": {
                    "type": "string",
                    "description": "Must be provided together with subjectType"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replay result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationReplayResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/sessions": {
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Start a session, or resume the caller’s active one for a chat",
        "description": "Reachable by a VISITOR principal (an opaque `tmp_` api token) as well as by an account — the four session routes are the only ones that are, because a visitor has no `game.players` row. A visitor’s session carries the empty-string owner, so these handlers scope on the visitor token id rather than on `customer_id`, which for an empty owner would match every other visitor’s rows. Passing `chat_id` resumes the caller’s own active session for that chat (200) instead of starting a second one; the owner predicate is part of that lookup, so a guessed `chat_id` resumes nothing.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameSessionStart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The caller’s existing active session for that chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameSession"
                }
              }
            }
          },
          "201": {
            "description": "The session that was started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameSession"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/sessions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "game"
        ],
        "summary": "One session the caller owns, with its subject artifact’s summary",
        "description": "The `summary` is the SUBJECT ARTIFACT’s — `game.sessions` has no such column — and is read through the session’s own `subject_artifact_id`, never through anything the caller supplies, so this cannot become a way to read an arbitrary artifact’s summary. `null` when the session names no artifact. A session belonging to someone else is 404, not 403: a 403 would confirm the id names a real session.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameSessionDetail"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "game"
        ],
        "summary": "End a session (idempotent; does NOT delete its artifact)",
        "description": "Ending an already-ended session is a no-op rather than a 409 — the guarantee is about the end state, so a client retrying after a dropped response gets the same answer twice. The session’s artifact is untouched: §6.3 makes ending a session and withdrawing its content two separate decisions.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Session ended (or already was)"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/sessions/{id}/events": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "game"
        ],
        "summary": "The session’s own event log, oldest first",
        "description": "`game.events` is in `SKIP_TABLES`, so generic CRUD serves no read of it — a client that posted an event and then reconnected would otherwise have no way to discover what it missed. The session is resolved through the same owner predicate FIRST, so this query never sees a session id the caller does not own.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the session’s events, ascending by `seq`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GameEvent"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Record one turn (idempotent on `client_event_id`)",
        "description": "**This endpoint runs no engine.** The caller runs its own turn and posts the result; adh appends it and assigns the next `seq`. A repeat of the same `client_event_id` returns the STORED row with 200 and executes nothing — which is what makes a dropped SSE connection safe to retry. 409 when the session has ended: the caller still owns it and can still read it, but it cannot advance. Naming an `artifact_id` counts one exposure against that artifact, and only on a genuine insert — never on a replay, or the retry would double-count.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameEventPost"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The already-recorded event for this `client_event_id`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameEvent"
                }
              }
            }
          },
          "201": {
            "description": "The recorded event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameEvent"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/artifacts": {
      "get": {
        "tags": [
          "game"
        ],
        "summary": "The caller’s own artifacts for one game",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the caller’s artifacts, most recently updated first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GameArtifact"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/artifacts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "game"
        ],
        "summary": "One artifact — anonymous when it is public, plus the caller’s own when signed in",
        "description": "No `security` because an anonymous caller is a supported caller: without a bearer token this serves any PUBLIC, non-withdrawn artifact by id, in any ecosystem (the id is the scope on a by-id read). WITH a bearer token it additionally serves the caller’s own private artifacts. A token that is present but invalid is 401, not a silent downgrade to the anonymous path — otherwise a caller could not tell a revoked session from a working one. The `body` bytea is never serialised here.",
        "responses": {
          "200": {
            "description": "The artifact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameArtifact"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "game"
        ],
        "summary": "Withdraw the caller’s own artifact (soft delete)",
        "description": "The ownership term is inside the UPDATE itself rather than a preceding read, so there is no check-then-write window. 404 covers both \"no such artifact\" and \"not yours\". Soft, not hard: `game.holdings` references artifacts with `restrict`, so a withdrawn artifact keeps every holding row recoverable.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Artifact withdrawn"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/artifacts/{id}/publish": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Publish the caller’s own artifact to the public feed (screened)",
        "description": "The write side §6.6 named and §6.3 owed: `visibility` and `published_at` are server-managed on `game.artifacts`, so this is the only way an artifact reaches `GET /game/feed`. Screening (§6.5) runs BEFORE the row flips, on every string the artifact carries — `text` plus every string leaf of `summary` and `data` — because adh cannot tell which jsonb slots hold player prose without doing the engine’s job. Long artifacts are screened in CHUNKS rather than truncated to the classifier’s character budget, which would publish the tail unjudged; past eight chunks the request is 422 rather than silently partly-screened. Idempotent: an already-published artifact returns 200 with the current row and calls no classifier, so a retry is free. 404 covers both \"no such artifact\" and \"not yours\" — the ownership term is in the UPDATE itself, so there is no check-then-write window. Publishing is one-way; withdrawing is `DELETE /game/artifacts/{id}`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The published artifact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameArtifact"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/feed": {
      "get": {
        "tags": [
          "game"
        ],
        "summary": "One game’s public artifact feed (anonymous, read replica)",
        "description": "The hot path, and it carries no `security`: it serves published artifacts to signed-out visitors and runs on the read replica so it does not contend with authenticated traffic. Three predicates are the entire boundary — `visibility = 'public'`, `deleted_at is null`, and `ecosystem_id`, which is taken from the resolved game row and never used as a caller-supplied filter. `ecosystem` only disambiguates which game a bare `slug` names — ecosystem slugs are unique under a parent, so two products really can both own a game called `chess`, and an unqualified ambiguous slug is a 409. A retired game is 404, and so is a product that is not in `game` mode.",
        "parameters": [
          {
            "name": "game_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ecosystem",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of published artifacts, most recently published first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "game",
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "game": {
                      "$ref": "#/components/schemas/GameRef"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GameFeedItem"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/holdings": {
      "get": {
        "tags": [
          "game"
        ],
        "summary": "What the caller has acquired in one game",
        "description": "Each row is joined to its artifact, because a holdings list renders as a list of THINGS and an id alone renders nothing. A holding whose artifact has been withdrawn is omitted rather than cascaded away, so it returns if the artifact is restored.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the caller’s holdings, most recently acquired first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GameHoldingWithArtifact"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "game"
        ],
        "summary": "Acquire an artifact (idempotent by the unique, not by a caller-sent key)",
        "description": "A toggle, not an append: `uq_holdings_customer_artifact` makes a repeat an update of the same row, so no `client_event_id` is involved — the row IS the key. `acquired_at` is deliberately NOT refreshed on a repeat, so re-tapping cannot reorder your own inventory. The artifact must belong to this game AND be one the caller may see; without that last test this route would be a read oracle over every other player’s private work. `customer_id` comes from the principal and is never read from the body, which is why this is not generic CRUD.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameHoldingPut"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The holding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameHolding"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "game"
        ],
        "summary": "Revoke a holding (no-op when not held)",
        "description": "The selector is on the query string rather than in a body: a DELETE body is legal but is dropped by enough proxies that a route depending on one fails intermittently, in somebody else’s infrastructure. 204 whether or not a row was hit — a 404 would distinguish \"you never held this\" from \"you did\".",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "artifact_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Not held (whether or not it was)"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/players/me": {
      "get": {
        "tags": [
          "game"
        ],
        "summary": "The caller’s own per-game profile",
        "description": "Only `/me`, and the absence of an id parameter is the security property: generic CRUD reads data-plane tables in OWNER mode, where `customer_id` is not a read filter, so a `GET /players/{id}` would be every profile in the ecosystem. 404 when the caller has never played this game — inventing a blank profile would make the PATCH below look like an update when it is the first write.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The caller’s profile for that game",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamePlayer"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "game"
        ],
        "summary": "Create or edit the caller’s own per-game profile",
        "description": "Omitting a key leaves the stored value alone; sending `null` clears it — without that distinction a character name could be replaced but never removed. Only the keys actually sent are written, so an avatar-only edit cannot reset `visibility` to the `private` default or rewrite `first_played_at`. A character name is SCREENED whenever it is set, not only when the profile is public, because visibility can be flipped later with no text change — a refused name is 422 and echoes nothing about the verdict. 422 also when the game’s `character_names` setting is `off`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GamePlayerPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The profile as stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamePlayer"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/profiles/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The ACCOUNT’s principal slug — never a per-game name"
        }
      ],
      "get": {
        "tags": [
          "game"
        ],
        "summary": "A player’s public per-game profile, by account slug (anonymous)",
        "description": "Addressed by the account’s own slug (§4.5.1: one account, one profile address) — a `character_name` is flavour and nothing is addressed by it. **Four independent gates, every failure the same 404**: the account exists and is not deleted; `customers.public_profile_enabled` (the account-wide opt-in, honoured here exactly as the sibling `/public/users/{slug}` routes honour it); the per-game `players.visibility` is `public` or `unlisted`; and the game is not retired. Distinguishing them would tell a caller that an account exists AND plays this game, which is the fact the setting exists to withhold. `characterName` is withheld when the game’s `character_names` is `off`, at read time — a name stored before the operator turned the feature off is still in the column. A fifth gate sits under all of them: the product must be in `game` mode. `ecosystem` disambiguates which game a bare `slug` names (an unqualified ambiguous slug is a 409).",
        "parameters": [
          {
            "name": "game_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ecosystem",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The public profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamePublicProfile"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/instances": {
      "get": {
        "tags": [
          "game"
        ],
        "summary": "The caller’s own instances, including what is inside what they hold",
        "description": "A recursive containment walk: everything located on the player, plus everything located inside those, and so on — the chest in the inventory and the key in the chest. Two INDEPENDENT bounds, and neither substitutes for the other: a depth cap (default and maximum 32) cuts a containment cycle, and a hard row limit (2000) cuts breadth, because a cycle at depth 2 fanning out ten ways per level is still 10^32 rows inside the depth cap. The row limit is applied BEFORE the sort, so a truncated walk returns the rows the walk reached first (shallowest first) rather than the smallest 2000 by sort key; on a well-formed world nothing is truncated and the two are the same. `location_id` carries no FK, so nothing is read from the request: the player id comes from the caller’s own resolved profile. A caller who has never played gets an empty list, not a 404.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The caller’s instances, shallowest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GameInstance"
                      }
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/state": {
      "get": {
        "tags": [
          "game"
        ],
        "summary": "The caller’s own scalars and lists, plus the game-wide ones",
        "description": "Two sets with different owners, and they are NOT merged. The `player`-subject rows are the caller’s alone; the `game`-subject rows are shared configuration (limits, global settings). A flat map would let a player-owned key silently shadow a global of the same name — a per-player rules change nobody authored — and the two have different lifetimes, so a merged map has no coherent cache policy. Values are ARRAYS throughout, including for a key with one row: §4.11 stores a scalar as \"one row at ordinal 0\" and a one-element list as the same thing, so collapsing single values would invent a distinction the storage does not carry.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The caller’s state and the game’s",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameState"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/terms": {
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Coin a term (screened; idempotent on the normalised key)",
        "description": "The one route in this feature that exists for a safety reason rather than a data one. A term is minted by a player and then appears in every OTHER player’s composer, so it is screened BEFORE the insert — a refused value mints no row. §5.2 folded `terms` into `game.definitions`, and one table cannot carry two write settings, so the restriction that used to live on the table lives on this path. Write-only: reading the roster is a `kind=term` read of `game.definitions` through generic CRUD. The `key` is the name lowercased with runs of non-alphanumerics collapsed to one hyphen, which is what makes \"Fire Ball\", \"fire ball\" and \"fire-ball\" one term; a name that normalises to nothing is 422. A term already coined returns the EXISTING row with 200 — the first coiner keeps the authorship credit — rather than a 409, because two players reaching the same word is the ordinary case for a shared vocabulary. `artifact_id` is recorded as `data.coined_from_artifact_id`, written over any caller-supplied value.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameTermPost"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The term as already coined",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameDefinition"
                }
              }
            }
          },
          "201": {
            "description": "The newly coined term",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameDefinition"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/login": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Authenticate one of the caller's end-customers (email + password)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "email or identifier is required (identifier is the generic alias).",
                "required": [
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "identifier": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "customer access token + opaque refresh token + customerId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAuthResult"
                }
              }
            }
          },
          "202": {
            "description": "second factor required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaChallenge"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The customer realm refuses: the ecosystem is gone or Client Auth was removed, or the ecosystem's policy has this switched off. error.code is one of: login_disabled, password_disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/login/mfa/sms/send": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Send the SMS login code to the challenged customer's verified primary phone",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "MFA pending token"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "code sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/login/mfa": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Complete customer login by satisfying the second factor → aal=2 session",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "method",
                  "code"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "MFA pending token"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "sms",
                      "totp",
                      "recovery"
                    ]
                  },
                  "code": {
                    "type": "string",
                    "maxLength": 40
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "customer access token + opaque refresh token + customerId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAuthResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The customer realm refuses: the ecosystem is gone or Client Auth was removed, or the ecosystem's policy has this switched off. error.code is one of: login_disabled, password_disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/refresh": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Rotate a live customer session (presented refresh token is single-use)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "refreshToken"
                ],
                "properties": {
                  "refreshToken": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The opaque refresh token from a prior login/refresh."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "new customer access token + rotated refresh token + customerId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAuthResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/register": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Provision one of the caller's end-customers with an ADH password credential",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8,
                    "description": "Must be at least 8 characters."
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 255
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "the new end-customer id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerRegisterResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The customer realm refuses: the ecosystem is gone or Client Auth was removed, or the ecosystem's policy has this switched off. error.code is one of: login_disabled, password_disabled, signup_closed, invite_required. In the hub realm: A caller who is not an operator may not give a hub account an address reserved for operators (\"this email cannot be self-assigned\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/resolve": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Map one of the caller's external user ids onto a stable ADH customerId (BYO bridge)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "The developer's own end-user id (the BYO join key)."
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 255
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "the resolved (idempotent upsert) customer id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResolveResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A caller who is not an operator may not give a hub account an address reserved for operators (\"this email cannot be self-assigned\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/revoke": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Revoke a customer refresh session (logout); idempotent",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "refreshToken"
                ],
                "properties": {
                  "refreshToken": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "session revoked (idempotent — always 204)"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/transfer": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Move one customer (and the workspace they own) to another ecosystem (admin)",
        "description": "Runs in ONE transaction. Rewrites the account tables, revokes API tokens scoped to the source, re-parents the ecosystems the user owns beneath it, and re-derives every affected rdid from the new parent chain. Old addresses remain resolvable as aliases.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "target"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "description": "the customer's uuid"
                  },
                  "target": {
                    "type": "string",
                    "description": "destination ecosystem (uuid or rdid)"
                  },
                  "dryRun": {
                    "type": "boolean",
                    "description": "report conflicts without writing"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What moved (or, for a dry run, what would collide)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    },
                    "moved": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer"
                      }
                    },
                    "revoked": {
                      "type": "integer",
                      "description": "API tokens deleted"
                    },
                    "ecosystemsReparented": {
                      "type": "integer"
                    },
                    "rewritten": {
                      "type": "integer",
                      "description": "addresses re-derived by the cascade"
                    },
                    "conflicts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "userId": {
                            "type": "string"
                          },
                          "constraint": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/transfer/preview": {
      "get": {
        "tags": [
          "customer"
        ],
        "summary": "What would collide if these users moved, without moving them (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "userIds",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "comma-separated customer uuids — the whole selection, in one call"
          },
          {
            "name": "target",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "destination ecosystem (uuid or rdid)"
          }
        ],
        "responses": {
          "200": {
            "description": "Conflicts across the whole selection",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "target": {
                      "type": "string"
                    },
                    "conflicts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "userId": {
                            "type": "string"
                          },
                          "constraint": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/memberships": {
      "get": {
        "tags": [
          "customer"
        ],
        "summary": "Which ecosystems these people are customers of (admin)",
        "description": "`customer.customers` is per-ecosystem, so one person is several rows and this answers a question about a SET of them, joined by EMAIL — the only column that identifies the same human in two tenancies. A customer with no email has exactly one membership here, correctly: nothing about them can be matched to a row elsewhere. Batched because the admin Users page needs the answer for every row it shows.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "userIds",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "comma-separated customer uuids, at most 200 per call"
          }
        ],
        "responses": {
          "200": {
            "description": "One entry per membership, per asked-about user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "userId": {
                        "type": "string",
                        "description": "the customer id the caller asked about"
                      },
                      "customerId": {
                        "type": "string",
                        "description": "the customer row that carries this membership — what a removal deletes"
                      },
                      "ecosystemId": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Make this person a customer of another ecosystem too (admin)",
        "description": "IDEMPOTENT: adding someone who is already a member reports the row they already had, with `created: false`. The new row takes its own slug — carrying the source slug over would collide with whoever holds it in the target, and a membership is not a claim on a handle. Refused with 400 for a customer who has no email, since nothing could ever tie the new row back to this person.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "ecosystemId"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "description": "the customer's uuid"
                  },
                  "ecosystemId": {
                    "type": "string",
                    "description": "destination ecosystem (uuid or rdid)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The membership, whether it was just made or already existed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string"
                    },
                    "customerId": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean",
                      "description": "false when they were already a member"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/memberships/{customerId}": {
      "delete": {
        "tags": [
          "customer"
        ],
        "summary": "Take this person out of ONE ecosystem (admin)",
        "description": "Addressed by the customer row that carries the membership, not by the person. Refuses the hub row with 400: that row is the person's ACCOUNT — their capabilities, their credentials and their address — so removing it is \"delete this user\", a different operation with a different confirmation.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "the customer row to remove, as reported by GET /customer/memberships"
          }
        ],
        "responses": {
          "200": {
            "description": "What was removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customerId": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "removed": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/discussion/topics": {
      "get": {
        "tags": [
          "discussion"
        ],
        "summary": "List the ecosystem’s live discussion topics (most-recently-active first)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "communityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ecosystem’s live topics, most-recently-active first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DiscussionTopic"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "discussion"
        ],
        "summary": "Create a topic (atomically born with its opening post; community admin only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title",
                  "body",
                  "communityId"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Opening-post markdown; stored as a content.markdown body document."
                  },
                  "communityId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "Community instance to create under; the caller must be its admin (else 403)."
                  },
                  "categoryId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "Optional category to file the topic under; must belong to the same community (else 400)."
                  },
                  "isPublic": {
                    "type": "boolean",
                    "description": "Whether anonymous callers can read the topic via /public/discussion (default true)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created topic",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscussionTopic"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/discussion/topics/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "discussion"
        ],
        "summary": "Get one live topic",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The topic",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscussionTopic"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "discussion"
        ],
        "summary": "Edit a topic title (author/admin) and/or moderation flags (community moderator)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "isPinned": {
                    "type": "boolean",
                    "description": "Community moderator only."
                  },
                  "isLocked": {
                    "type": "boolean",
                    "description": "Community moderator only."
                  },
                  "answeredPostId": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 36,
                    "description": "Topic author or community moderator; must be a live post in this topic (or null to clear)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated topic",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscussionTopic"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "discussion"
        ],
        "summary": "Soft-delete a topic (author or admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Topic deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/discussion/topics/{id}/posts": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "discussion"
        ],
        "summary": "List a topic’s live posts (with resolved markdown bodies), thread order",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The topic’s live posts in thread order (post_number ASC)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DiscussionPost"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "discussion"
        ],
        "summary": "Reply to a topic (bumps the topic’s reply count + last activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "body"
                ],
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Reply markdown; stored as a content.markdown body document."
                  },
                  "parentPostId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "Id of the post this reply nests under (a flat reply when omitted)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created reply post",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscussionPost"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/discussion/posts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "discussion"
        ],
        "summary": "Soft-delete a reply post (author or admin; not the opening post)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Post deleted"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/discussion/topics": {
      "get": {
        "tags": [
          "discussion"
        ],
        "summary": "List the hub’s live PUBLIC topics (anonymous; author id omitted)",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ecosystem’s live topics, most-recently-active first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DiscussionTopic"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/public/discussion/topics/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "discussion"
        ],
        "summary": "Get one live PUBLIC hub topic (404 if missing/private/deleted — indistinguishable)",
        "responses": {
          "200": {
            "description": "The public topic",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscussionTopic"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/discussion/topics/{id}/posts": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "discussion"
        ],
        "summary": "List a PUBLIC topic’s live posts (with resolved markdown bodies), thread order",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The topic’s live posts in thread order (post_number ASC)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DiscussionPost"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/feature-flags/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "An ecosystem's feature flags, by key (owner or admin, or an end-customer of this ecosystem)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Flags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "flags"
                  ],
                  "properties": {
                    "flags": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcosystemFeatureFlag"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Create one flag on the ecosystem (409 if the key exists)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "enabled": {
                    "type": "boolean",
                    "default": false
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created flag",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemFeatureFlag"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/feature-flags/{id}/{key}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Update one existing flag (404 if missing)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  }
                },
                "description": "At least one of enabled, description is required"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated flag",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemFeatureFlag"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Remove one flag",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/features/catalog": {
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "The features an ecosystem can be provisioned with",
        "description": "The whole catalog, independent of any ecosystem — what the feature picker renders. Static: it changes only when the server ships a new feature.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "features"
                  ],
                  "properties": {
                    "features": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CatalogFeature"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/features/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "An ecosystem's provisioned features (its managers, or a member of the owning org)",
        "description": "Every row, INCLUDING removed ones — a removed feature’s artifacts still exist, so the picker can say that re-adding it is free.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The ecosystem’s features",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "features"
                  ],
                  "properties": {
                    "features": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProvisionedFeature"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Provision features onto the ecosystem",
        "description": "Creates whatever each feature needs — the storage buckets, the system roles, the ecosystem’s Project — in ONE transaction, so a partial failure rolls back whole. A key that is already active is a no-op, not a conflict. Returns the ecosystem’s full feature list afterwards. 422 when the ecosystem has no workspace principal behind it and a requested feature needs one.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "keys"
                ],
                "properties": {
                  "keys": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64
                    },
                    "description": "Catalog feature keys to provision. A list, because the picker adds several behind one confirmation — one confirmation is one request and one transaction."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The ecosystem’s features",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "features"
                  ],
                  "properties": {
                    "features": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProvisionedFeature"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/features/{id}/availability": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "The catalog features this ecosystem may not add, and why",
        "description": "An ecosystem cannot hold a feature whose `allowedIn` omits its type (a product cannot hold Organizations). The picker disables exactly these, and POST /ecosystem/features/{id} refuses the same list; POST and DELETE on a Personal or Organization ecosystem are 409. Coming-soon features are not listed — the catalog already marks them.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Unavailable features",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "unavailable"
                  ],
                  "properties": {
                    "unavailable": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UnavailableFeature"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/features/{id}/{key}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Take a feature off the ecosystem",
        "description": "Marks the feature removed and DESTROYS NOTHING — the buckets, roles and rows it provisioned are left exactly as they are. Taking a feature off the rail is a display decision; deleting the owner’s data is not, and the two do not share a verb. What comes with the feature (`includedWith`) is taken off with it; a feature that comes with another cannot be taken off on its own (400).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Nothing was removed: another active feature needs this one (feature_required), or this is a Personal or Organization ecosystem, whose features are fixed (a plain error)",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "error"
                      ],
                      "properties": {
                        "error": {
                          "type": "object",
                          "required": [
                            "code",
                            "message",
                            "neededBy"
                          ],
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "feature_required"
                              ]
                            },
                            "message": {
                              "type": "string",
                              "description": "this feature is needed by <labels>"
                            },
                            "neededBy": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "Keys of the active features that require this one or what comes with it, named by the feature the picker lists."
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/chat-definitions/{ecosystemId}": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "An ecosystem's chat definitions",
        "description": "The built-in `direct` definition first, then every definition that is not deleted — archived ones included.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The definitions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "definitions"
                  ],
                  "properties": {
                    "definitions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChatDefinition"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "Define a chat",
        "description": "400 when maxParticipants is below 2 or above the system maximum, the slug is invalid or `direct`, or a persona is not usable. 409 when a live definition already has the slug.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatDefinitionCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new definition",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "definition"
                  ],
                  "properties": {
                    "definition": {
                      "$ref": "#/components/schemas/ChatDefinition"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/chat-definitions/{ecosystemId}/{definitionId}": {
      "parameters": [
        {
          "name": "ecosystemId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "definitionId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "chat"
        ],
        "summary": "Change a chat definition",
        "description": "Partial update, validated as POST is. The built-in `direct` definition is read-only (400).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatDefinitionUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The definition after the update",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "definition"
                  ],
                  "properties": {
                    "definition": {
                      "$ref": "#/components/schemas/ChatDefinition"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "chat"
        ],
        "summary": "Delete a chat definition",
        "description": "A SOFT delete: chats created from it keep working, and its slug is free again. The built-in `direct` definition cannot be deleted (400).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/server-bag/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "An ecosystem's server-bag entries, by key (owner or admin, or an end-customer of this ecosystem)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "bags"
                  ],
                  "properties": {
                    "bags": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcosystemServerBagEntry"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Create one bag entry on the ecosystem (409 if the key exists)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "value"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "value": {
                    "description": "Arbitrary JSON value"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemServerBagEntry"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/server-bag/{id}/{key}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Update one existing bag entry (404 if missing)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "description": "Arbitrary JSON value"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  }
                },
                "description": "At least one of value, description is required"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemServerBagEntry"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Remove one bag entry",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/communities/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "Get one community instance (+ its settings) by slug",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The community instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Community"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/communities/{id}/categories": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "List a community’s categories (display order; private instance: members only → 404)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The community’s categories, in display order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommunityCategory"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "community"
        ],
        "summary": "Create a category (community admin only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "description": "Unique per community."
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "color": {
                    "type": "string",
                    "maxLength": 16,
                    "description": "Display color (e.g. a hex string)."
                  },
                  "displayOrder": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Sort order within the community."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created category",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityCategory"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/communities/{id}/categories/{catId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "catId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "community"
        ],
        "summary": "Edit a category (community admin only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "color": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "displayOrder": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "isPublic": {
                    "type": "boolean"
                  },
                  "isArchived": {
                    "type": "boolean",
                    "description": "true archives (the admin \"delete\") — hidden from every list, discussions retained."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated category",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityCategory"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/communities/{id}/topics": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "List a community’s live topics (filter by category, sort, paged; private instance: members only → 404)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "recent",
                "popular",
                "trending"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The community’s live topics + a total count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DiscussionTopic"
                      }
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/communities/{id}/members": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "List the membership roster (community admin only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The community’s membership roster",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommunityMember"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "community"
        ],
        "summary": "Grant a membership role (community admin only; idempotent upsert; the grantee must be a real customer → 404)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "customerId",
                  "role"
                ],
                "properties": {
                  "customerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "moderator",
                      "member"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The granted membership row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityMember"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/communities/{id}/members/me": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "Get the caller’s OWN role in a community (null when not a member)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The caller’s role, or null when they hold no membership",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "role"
                  ],
                  "properties": {
                    "role": {
                      "type": "string",
                      "nullable": true,
                      "description": "owner | admin | moderator | member, or null (not a member)."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "community"
        ],
        "summary": "Update the caller’s OWN membership bio (members only; \"\" clears it)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "bio"
                ],
                "properties": {
                  "bio": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "One-line \"what I’m building\" intro for this community."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated membership row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityMember"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/communities/{id}/directory": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "The people directory: every member with display identity, bio, role, and activity (public instance: any signed-in user; private: members only → 404)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The community’s members, oldest joiner first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommunityDirectoryEntry"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/communities/{id}/profiles": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "Resolve member display identities: ?ids=a,b,c (batch, ≤200) or ?q=prefix (autocomplete, ≤8) (public instance: any signed-in user; private: members only → 404)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The matching members’ display profiles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommunityProfile"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/communities/{id}/members/{customerId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "customerId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "community"
        ],
        "summary": "Revoke a membership (community admin only; the owner cannot be removed)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Membership revoked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/communities/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "Get one PUBLIC hub community by slug (404 if missing/private — indistinguishable)",
        "responses": {
          "200": {
            "description": "The public community instance (no settings)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCommunity"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/communities/{id}/categories": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "List a PUBLIC hub community’s public categories",
        "responses": {
          "200": {
            "description": "The community’s categories, in display order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommunityCategory"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/communities/{id}/topics": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "community"
        ],
        "summary": "List a PUBLIC hub community’s public topics (author id omitted)",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "recent",
                "popular",
                "trending"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The community’s live topics + a total count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DiscussionTopic"
                      }
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown": {
      "parameters": [
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List/search the caller's markdown documents (metadata only)",
        "description": "Lists the caller’s documents, most-recently-updated first. Optional filters narrow the set: `q` (free-text, case-insensitive substring across title, body, category, and tags), `category` (exact match), and `tag` (set membership).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text query matched across title, body, category, and tags.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Restrict to documents with this exact category.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Restrict to documents whose tag set contains this tag.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Restrict to documents whose frontmatter adh_source equals this value. Used by researchUpsert to look up an existing doc without scanning the full export.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "visibility",
            "in": "query",
            "required": false,
            "description": "Restrict to documents with this visibility — `public` lists the published ones (papers). An unknown value is a 400.",
            "schema": {
              "type": "string",
              "enum": [
                "private",
                "public"
              ]
            }
          },
          {
            "name": "noted",
            "in": "query",
            "required": false,
            "description": "Send true to restrict to NOTES — the documents filed in the owner's `notes` storage bucket (a live content.notes marker). A false value is the unfiltered list; there is no \"not a note\" filter. A value that is neither is a 400, not a silently unfiltered list.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "doc",
            "in": "query",
            "required": false,
            "description": "Send true to restrict to DOCS — the documents filed in the owner's `docs` storage bucket (a live content.docs marker). The informal corpus: anything written down that is neither a note nor a composed paper. Same rules as `noted`: false is the unfiltered list, and an unparseable value is a 400.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of document metadata, most-recently-updated first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MarkdownDocumentSummary"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create a markdown document (writes the head + version 1)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "content"
                ],
                "properties": {
                  "content": {
                    "type": "string",
                    "description": "Full raw markdown (stored byte-exact). The title is derived from it — see the response `title`."
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Optional classification label."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "maxItems": 100,
                    "description": "Optional tag set (trimmed + de-duplicated server-side)."
                  },
                  "author": {
                    "type": "object",
                    "description": "Author of this revision; omit to attribute to the calling customer. customer/user are pinned to the caller; other types are caller-asserted (unverified).",
                    "properties": {
                      "type": {
                        "type": "string",
                        "maxLength": 32,
                        "description": "Lower-cased. e.g. 'customer', 'user', 'persona', 'agent', 'system'."
                      },
                      "id": {
                        "type": "string",
                        "maxLength": 128,
                        "description": "Id within that type's namespace (ignored for customer/user — pinned to the caller)."
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255,
                        "description": "Display label; ignored for customer/user (taken from the principal)."
                      }
                    }
                  },
                  "note": {
                    "type": "boolean",
                    "description": "Send `true` to file the new document in the owner's `notes` storage bucket (mints its content.notes marker). It stays an ordinary markdown document in every other respect — same versions, same category/tags — and `?noted=true` is how you list them back."
                  },
                  "doc": {
                    "type": "boolean",
                    "description": "Send `true` to file the new document in the owner's `docs` storage bucket (mints its content.docs marker). Independent of `note` — the markers are separate rows — and `?doc=true` is how you list them back."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownDocument"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/categories": {
      "parameters": [
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List the caller's existing categories (names + the category HIERARCHY)",
        "description": "The account's full set of categories (content.categories), scoped to the workspace owner and ecosystem. `items` is the distinct, alphabetical NAME list — the autocomplete/browse source for the research classification UI. `nodes` is the same set with its structure kept (id + parentIds), which is what a hierarchical browser folds. The hierarchy is a DAG, not a tree: a category may sit under any number of parents, or none.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Category names (alphabetical) and the category nodes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownCategoryTree"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create a category, optionally nested under one or more others",
        "description": "Mints a category for the workspace owner. Omit `parentIds` (or send an empty array) for an unfiled category. A category NAME is unique per owner across the whole hierarchy — every other op addresses a category by name — so re-posting an existing name is idempotent ONLY when every parent it asks for is already one of that category's parents; asking for a new one is a 409. This never RE-FILES a category: adding a parent to an existing one is an edge write on /content/category-edges. Any id in `parentIds` that isn't one of this owner's live categories is a 404.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "description": "The category name (unique per owner)."
                  },
                  "parentIds": {
                    "type": "array",
                    "maxItems": 8,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 36
                    },
                    "description": "Ids of the categories this one sits under at creation — up to 8, or none. Omit or send [] for an unfiled category. This cap bounds validation cost on the create call only; a category can end up under any number of parents in total by adding further edges afterwards, via POST /content/category-edges."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The existing category with this name (already under every requested parent)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownCategoryNode"
                }
              }
            }
          },
          "201": {
            "description": "The created category",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownCategoryNode"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/tags": {
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List the caller's existing tag labels (autocomplete source)",
        "description": "The account's full set of tag labels (content.keywords), scoped to the caller and ecosystem, distinct and alphabetical — the autocomplete/browse source for the research tag field. `nodes` is the same set with each label's row id, which is what addresses a tag for a rename or delete.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Tag labels (alphabetical) and the keyword nodes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownTagSet"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/export": {
      "parameters": [
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Bulk export the caller's documents WITH content (download a whole set)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "All documents (with content), ordered by createdAt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "truncated"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MarkdownDocument"
                      }
                    },
                    "truncated": {
                      "type": "boolean",
                      "description": "True if more documents remain (the export stopped at its approximate byte budget)."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get a markdown document (with content)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownDocument"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update a document; a content change appends a full-state version",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one of content/category/tags. A content change appends a full-state version (author attaches to it) and re-derives the title; a category/tags-only change updates the head in place WITHOUT a new version; a no-op returns the doc unchanged.",
                "properties": {
                  "content": {
                    "type": "string",
                    "description": "New raw markdown; a real change bumps current_version and re-derives the title."
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 200,
                    "nullable": true,
                    "description": "Classification label; send null to clear, omit to leave unchanged."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "maxItems": 100,
                    "description": "Replacement tag set (trimmed + de-duplicated); omit to leave unchanged."
                  },
                  "author": {
                    "type": "object",
                    "description": "Author of this revision; omit to attribute to the calling customer. customer/user are pinned to the caller; other types are caller-asserted (unverified).",
                    "properties": {
                      "type": {
                        "type": "string",
                        "maxLength": 32,
                        "description": "Lower-cased. e.g. 'customer', 'user', 'persona', 'agent', 'system'."
                      },
                      "id": {
                        "type": "string",
                        "maxLength": 128,
                        "description": "Id within that type's namespace (ignored for customer/user — pinned to the caller)."
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255,
                        "description": "Display label; ignored for customer/user (taken from the principal)."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownDocument"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Soft-delete a document",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}/raw": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get the raw markdown bytes (text/markdown), with an ETag",
        "description": "Returns the content verbatim. Send If-None-Match with the ETag for a 304.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Raw markdown content",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (ETag matched)"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}/route-available/{route}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "route",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Check whether a public route slug is free for this document",
        "description": "The live availability check behind the publish field. It answers the SAME question `POST /{id}/publish` answers with a 409, against the same author and the same exclusion (a document’s own route is never taken for itself), so the two can never disagree. Always 200 with a verdict — an unavailable route is an answer, not an error. 404s a missing, deleted, or non-owned document BEFORE looking at the route, so it cannot be used to probe another author’s slug space.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "available",
                    "reason"
                  ],
                  "properties": {
                    "available": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "invalid",
                        "reserved",
                        "taken"
                      ],
                      "description": "`ok` when available. `invalid` — wrong shape (lowercase, [a-z0-9_-], leading alphanumeric, 2–128 chars). `reserved` — a word the site’s own routing owns. `taken` — another live paper of this author already publishes there."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}/publish": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Publish a document under an author-defined public route slug",
        "description": "Makes the document readable UNAUTHENTICATED at /public/users/{slug}/papers/{route}. The route is lowercase, url-safe, and UNIQUE PER AUTHOR — a collision with another of the caller’s live papers returns 409.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "route"
                ],
                "properties": {
                  "route": {
                    "type": "string",
                    "description": "Public route slug: lowercase, url-safe ([a-z0-9_-], leading alphanumeric), 2–128 chars."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The published document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownDocument"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}/unpublish": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Unpublish a document (revert to a private draft, freeing its route)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The unpublished document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownDocument"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}/finalize": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Finalize a document (stage='final'; content becomes immutable)",
        "description": "Marks the document final: content edits and version restores are rejected with 409 until definalize. Publication state is deliberately NOT covered — a final document can still be published/unpublished. Idempotent: re-finalizing a final document is a 200 no-op.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The finalized document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownDocument"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}/definalize": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Definalize a document (revert to stage='draft'; edits work again)",
        "description": "Reverts a final document to an editable draft, lifting the content-immutability guard. Idempotent: definalizing a draft is a 200 no-op.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The definalized document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownDocument"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}/versions": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List a document’s versions, newest first (metadata only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Version metadata, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MarkdownDocumentVersionSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}/versions/{version}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "version",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get one version (with content)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The version snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownDocumentVersion"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/markdown/{id}/versions/{version}/restore": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "version",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to). Omitted: the caller’s own documents. Unknown/foreign slug: 404."
        },
        {
          "name": "ecosystemId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Act in this ECOSYSTEM (uuid or rdid) instead of the token’s: list its documents, and file a new one in it. It must be the caller’s own or one they manage. Unknown: 404. Not manageable: 403."
        }
      ],
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Restore a version (re-applies its full state as a new version; non-destructive)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The document after restore",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownDocument"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/log": {
      "get": {
        "tags": [
          "messaging"
        ],
        "summary": "List the message log (admin), newest first, with optional filters",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message-log page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingLogPage"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/log/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "messaging"
        ],
        "summary": "Get a single message-log entry by id (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Message-log entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingLogEntry"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/me/messages": {
      "get": {
        "tags": [
          "messaging"
        ],
        "summary": "The caller's own message history (self), newest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message-log page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingLogPage"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/status": {
      "get": {
        "tags": [
          "messaging"
        ],
        "summary": "Which messaging channels are configured + enabled (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Provider status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingStatus"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/templates": {
      "get": {
        "tags": [
          "messaging"
        ],
        "summary": "List the available outbound message templates (any signed-in user)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MessagingTemplate"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/send": {
      "post": {
        "tags": [
          "messaging"
        ],
        "summary": "Send an email/SMS to a user — freeform or via a template (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "channel"
                ],
                "description": "Provide either body or templateId, not both.",
                "properties": {
                  "userId": {
                    "type": "string",
                    "maxLength": 36,
                    "description": "Target user id"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms"
                    ]
                  },
                  "subject": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Email subject (freeform)"
                  },
                  "body": {
                    "type": "string",
                    "description": "Freeform message body"
                  },
                  "templateId": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Template id (alternative to body)"
                  },
                  "templateVars": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Substitution values for the template placeholders"
                  },
                  "recipient": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Override recipient; required for SMS, optional for email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingSendResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Send failed (e.g. provider unconfigured); logged with status failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingSendResult"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/ecosystems/{id}/status": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "messaging"
        ],
        "summary": "Which messaging channels are configured for this ecosystem (owner/admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Provider status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingStatus"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/ecosystems/{id}/log": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "messaging"
        ],
        "summary": "This ecosystem's message log, newest first (owner/admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message-log page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingLogPage"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/ecosystems/{id}/send": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "messaging"
        ],
        "summary": "Send an email/SMS via this ecosystem's providers — freeform or template (owner/admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "channel"
                ],
                "description": "Provide either body or templateId, not both.",
                "properties": {
                  "userId": {
                    "type": "string",
                    "maxLength": 36,
                    "description": "Target customer id (within this ecosystem)"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms"
                    ]
                  },
                  "subject": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Email subject (freeform)"
                  },
                  "body": {
                    "type": "string",
                    "description": "Freeform message body"
                  },
                  "templateId": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Template id (alternative to body)"
                  },
                  "templateVars": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Template placeholder values"
                  },
                  "recipient": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Override recipient; required for SMS, optional for email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingSendResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Send failed (logged)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingSendResult"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/preferences/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "notifications"
        ],
        "summary": "Reset the caller's notification preferences (id must be the caller's user id)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Preferences cleared"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications": {
      "get": {
        "tags": [
          "notifications"
        ],
        "summary": "List the caller's in-app notifications (paginated, filterable)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Filter to these categories (repeatable; the union). Absent = all."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "inbox",
                "archived",
                "trashed"
              ],
              "default": "inbox"
            },
            "description": "Inbox lifecycle bucket to list; default inbox."
          },
          {
            "name": "read",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Filter by read state; absent = both."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of notifications",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Notification"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/preferences": {
      "get": {
        "tags": [
          "notifications"
        ],
        "summary": "List the caller's notification preferences (all categories)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "All preferences (one per category)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "preferences"
                  ],
                  "properties": {
                    "preferences": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NotificationPreference"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "notifications"
        ],
        "summary": "Create a notification preference for one category",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "category",
                  "email",
                  "sms"
                ],
                "properties": {
                  "category": {
                    "type": "string",
                    "enum": [
                      "account",
                      "community_reply",
                      "community_mention",
                      "admin_announcement",
                      "direct_message",
                      "project_assigned",
                      "project_mention",
                      "project_comment",
                      "project_status",
                      "project_due"
                    ]
                  },
                  "email": {
                    "type": "boolean"
                  },
                  "sms": {
                    "type": "boolean"
                  },
                  "inApp": {
                    "type": "boolean",
                    "description": "In-app (inbox) delivery for this category. Omitted means true — the PUT replaces the row wholesale, so a client that edits only email/sms must send back the value it read."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Preference created; all preferences returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "preferences"
                  ],
                  "properties": {
                    "preferences": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NotificationPreference"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "notifications"
        ],
        "summary": "Bulk upsert notification preferences across categories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "preferences"
                ],
                "properties": {
                  "preferences": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "category",
                        "email",
                        "sms"
                      ],
                      "properties": {
                        "category": {
                          "type": "string",
                          "enum": [
                            "account",
                            "community_reply",
                            "community_mention",
                            "admin_announcement",
                            "direct_message",
                            "project_assigned",
                            "project_mention",
                            "project_comment",
                            "project_status",
                            "project_due"
                          ]
                        },
                        "email": {
                          "type": "boolean"
                        },
                        "sms": {
                          "type": "boolean"
                        },
                        "inApp": {
                          "type": "boolean",
                          "description": "In-app (inbox) delivery for this category. Omitted means true — the PUT replaces the row wholesale, so a client that edits only email/sms must send back the value it read."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All preferences (one per category)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "preferences"
                  ],
                  "properties": {
                    "preferences": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NotificationPreference"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/preferences/{category}": {
      "parameters": [
        {
          "name": "category",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "notifications"
        ],
        "summary": "Get the caller's preference for one category (defaults if unset)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Preference for the category",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationPreference"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/unread-count": {
      "get": {
        "tags": [
          "notifications"
        ],
        "summary": "Count the caller's unread notifications",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Unread count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/read-all": {
      "post": {
        "tags": [
          "notifications"
        ],
        "summary": "Mark all of the caller's notifications as read",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/stream": {
      "get": {
        "tags": [
          "notifications"
        ],
        "summary": "Wake on new notifications (SSE)",
        "description": "Server-Sent Events (`text/event-stream`). Emits a `notification` event with an empty `{}` payload each time something lands for the caller; re-read GET /notifications or /notifications/unread-count to find out what.\n\nIf the backend was started without a notification hub, the stream instead emits a single `ready` event and closes immediately — the client should fall back to polling. Otherwise it stays open for at most 5 minutes and then closes with no terminal event; reconnect.\n\nBecause a browser `EventSource` cannot set headers, the bearer token may be passed as an `access_token` query parameter instead. Connecting also marks the caller present, and disconnecting marks them away.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "description": "The bearer token, for clients that cannot send an Authorization header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream of `notification` wake events (or one `ready` event, then close)",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationWakeEvent"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/{id}/read": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "notifications"
        ],
        "summary": "Mark one notification as read",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/{id}/unread": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "notifications"
        ],
        "summary": "Mark one notification as unread",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/{id}/archive": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "notifications"
        ],
        "summary": "Archive one notification",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/{id}/trash": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "notifications"
        ],
        "summary": "Trash one notification",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/friends": {
      "get": {
        "tags": [
          "friends"
        ],
        "summary": "The caller's accepted friends (each entry names the OTHER user; paginated)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the caller's friends",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FriendEntry"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/friends/requests": {
      "get": {
        "tags": [
          "friends"
        ],
        "summary": "Pending friend requests — ?direction=received (default, the caller's inbox) | sent",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "received",
                "sent"
              ],
              "default": "received"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of pending friend requests, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Friendship"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "friends"
        ],
        "summary": "Send a friend request (idempotent on the unordered pair; mutual → auto-accept)",
        "description": "Creates a pending friendship with the caller as requester. If an edge for the unordered pair already exists in either direction no second row is created: a pending request FROM the other user is auto-accepted (both sides asked), a pending request from the caller or an accepted friendship is returned as-is, and a declined edge flips back to pending with the caller as requester. Refused (403) while a block exists in either direction between the two users.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "description": "The customer id of the user to befriend"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The existing (or auto-accepted / re-requested) friendship",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Friendship"
                }
              }
            }
          },
          "201": {
            "description": "The created pending friendship",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Friendship"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/friends/requests/{id}/accept": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "friends"
        ],
        "summary": "Accept a pending friend request (addressee only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The accepted friendship",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Friendship"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/friends/requests/{id}/decline": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "friends"
        ],
        "summary": "Decline a pending friend request (addressee only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The declined friendship",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Friendship"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/friends/{userId}": {
      "parameters": [
        {
          "name": "userId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "friends"
        ],
        "summary": "Remove the friendship/request between the caller and a user (either party)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Friendship removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/follows/following": {
      "get": {
        "tags": [
          "follows"
        ],
        "summary": "Users the caller follows (paginated)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the caller's outbound follows, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Follow"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/follows/followers": {
      "get": {
        "tags": [
          "follows"
        ],
        "summary": "Users following the caller (paginated)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the caller's inbound follows, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Follow"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/follows/{userId}": {
      "parameters": [
        {
          "name": "userId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "follows"
        ],
        "summary": "Follow a user (idempotent — one-way, no permission semantics)",
        "description": "Creates the caller→user follow edge. A follow is a subscription, not a grant: it needs no consent and carries no permission weight. Idempotent — repeating the call returns the existing edge (200) instead of creating a second row.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The already-existing follow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Follow"
                }
              }
            }
          },
          "201": {
            "description": "The created follow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Follow"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "follows"
        ],
        "summary": "Unfollow a user",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Follow removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/blocks": {
      "get": {
        "tags": [
          "blocks"
        ],
        "summary": "Users the caller has blocked (paginated)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the caller's blocks, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UserBlock"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/blocks/{userId}": {
      "parameters": [
        {
          "name": "userId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "blocks"
        ],
        "summary": "Block a user (idempotent; severs any friendship between the pair)",
        "description": "Creates the caller→user block. Blocking removes any existing friendship or pending request between the two users in the same transaction, and new friend requests are refused (403) while a block exists in either direction. Follows are untouched — they carry no permission weight. Idempotent — repeating the call returns the existing block (200) instead of creating a second row.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The already-existing block",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserBlock"
                }
              }
            }
          },
          "201": {
            "description": "The created block",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserBlock"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "blocks"
        ],
        "summary": "Unblock a user (does NOT restore a severed friendship)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Block removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/bookmarks": {
      "get": {
        "tags": [
          "bookmarks"
        ],
        "summary": "List the caller's bookmarks (newest first, paginated)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "targetKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of bookmarks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Bookmark"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "bookmarks"
        ],
        "summary": "Add or re-affirm a bookmark (idempotent on the caller + target)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "targetKind",
                  "targetId"
                ],
                "properties": {
                  "targetKind": {
                    "type": "string"
                  },
                  "targetId": {
                    "type": "string"
                  },
                  "notify": {
                    "type": "boolean",
                    "description": "Also subscribe to the target’s activity notifications (default false)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created (or re-affirmed) bookmark",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bookmark"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/bookmarks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "bookmarks"
        ],
        "summary": "Remove one of the caller's bookmarks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Bookmark removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/notes": {
      "get": {
        "tags": [
          "notes"
        ],
        "summary": "List the caller's notes (newest first, paginated)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of notes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Note"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "notes"
        ],
        "summary": "Create a note (a markdown doc + a marker); the title derives from the first line",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "content"
                ],
                "properties": {
                  "content": {
                    "type": "string",
                    "description": "The note’s raw markdown body."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created note",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/notes/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "notes"
        ],
        "summary": "Un-note a doc (removes the marker only; the markdown doc survives)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Note removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/reactions": {
      "get": {
        "tags": [
          "interactions"
        ],
        "summary": "List all reactions on one target, or a batch of them (public within the ecosystem)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "targetKind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "targetId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "One subject. Supply this OR targetIds; one of the two is required."
          },
          {
            "name": "targetIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Up to 200 comma-separated subject ids, so a surface showing many subjects reads them in ONE request — each item carries its own targetId for grouping. Supply this OR targetId; one of the two is required. Over 200 is a 400."
          }
        ],
        "responses": {
          "200": {
            "description": "Reactions on the target(s)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Reaction"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "interactions"
        ],
        "summary": "Add a reaction (idempotent on the caller's target+emoji)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "targetKind",
                  "targetId",
                  "emoji"
                ],
                "properties": {
                  "targetKind": {
                    "type": "string"
                  },
                  "targetId": {
                    "type": "string"
                  },
                  "emoji": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reaction already existed (idempotent)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reaction"
                }
              }
            }
          },
          "201": {
            "description": "Reaction created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reaction"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/reactions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "interactions"
        ],
        "summary": "Remove one of the caller's reactions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Reaction removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/poll-votes": {
      "get": {
        "tags": [
          "interactions"
        ],
        "summary": "Tally a poll — per-option counts + the caller’s chosen options",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "pollId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Poll tally",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollTally"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "interactions"
        ],
        "summary": "Cast a vote (single-choice polls replace the caller’s prior vote)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "optionId"
                ],
                "properties": {
                  "optionId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Vote already existed (idempotent)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollVote"
                }
              }
            }
          },
          "201": {
            "description": "Vote cast",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollVote"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/poll-votes/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "interactions"
        ],
        "summary": "Remove one of the caller's votes",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Vote removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/contacts": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "List the caller's contact methods (email + phone)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The caller’s contact methods",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ContactMethod"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Add a contact method (unverified). First of a kind becomes primary.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "value"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "email",
                      "phone"
                    ]
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 255
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Contact created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactMethod"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/contacts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "contacts"
        ],
        "summary": "Delete a contact method (the primary email cannot be deleted)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Contact deleted"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/contacts/{id}/verify/start": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Send a 6-digit verification code to the contact",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Code sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/contacts/{id}/verify/confirm": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Confirm a contact with the code that was sent",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "maxLength": 16
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa": {
      "get": {
        "tags": [
          "mfa"
        ],
        "summary": "The caller's enrolled second factors + preferred method",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Factor status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "sms",
                    "totp",
                    "webauthn",
                    "totpPending",
                    "recoveryRemaining",
                    "preferredMethod"
                  ],
                  "properties": {
                    "sms": {
                      "type": "boolean"
                    },
                    "totp": {
                      "type": "boolean"
                    },
                    "webauthn": {
                      "type": "boolean"
                    },
                    "totpPending": {
                      "type": "boolean",
                      "description": "A TOTP enrollment awaits confirmation"
                    },
                    "recoveryRemaining": {
                      "type": "integer",
                      "description": "Unused recovery codes"
                    },
                    "preferredMethod": {
                      "type": "string",
                      "nullable": true,
                      "enum": [
                        "sms",
                        "totp",
                        "webauthn",
                        null
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/preference": {
      "get": {
        "tags": [
          "mfa"
        ],
        "summary": "The caller’s preferred 2FA method",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Preference",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "preferredMethod"
                  ],
                  "properties": {
                    "preferredMethod": {
                      "type": "string",
                      "nullable": true,
                      "enum": [
                        "sms",
                        "totp",
                        "webauthn",
                        null
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "mfa"
        ],
        "summary": "Set the preferred 2FA method",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "method"
                ],
                "properties": {
                  "method": {
                    "type": "string",
                    "enum": [
                      "sms",
                      "totp",
                      "webauthn"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preference",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "preferredMethod"
                  ],
                  "properties": {
                    "preferredMethod": {
                      "type": "string",
                      "enum": [
                        "sms",
                        "totp",
                        "webauthn"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/recovery": {
      "get": {
        "tags": [
          "mfa"
        ],
        "summary": "How many unused recovery codes remain",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Remaining",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "remaining"
                  ],
                  "properties": {
                    "remaining": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/recovery/regenerate": {
      "post": {
        "tags": [
          "mfa"
        ],
        "summary": "Generate a fresh recovery-code set (invalidates the old one); shown once",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Plaintext recovery codes (returned once)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "codes"
                  ],
                  "properties": {
                    "codes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/totp/enroll": {
      "post": {
        "tags": [
          "mfa"
        ],
        "summary": "Begin TOTP enrollment → otpauth URI + secret (shown once)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Provisioning material",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "secret",
                    "otpauthUri"
                  ],
                  "properties": {
                    "secret": {
                      "type": "string",
                      "description": "Base32 secret (for manual entry)"
                    },
                    "otpauthUri": {
                      "type": "string",
                      "description": "otpauth:// URI to render as a QR code"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/totp/confirm": {
      "post": {
        "tags": [
          "mfa"
        ],
        "summary": "Confirm TOTP enrollment with a current code",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "maxLength": 16
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/totp": {
      "delete": {
        "tags": [
          "mfa"
        ],
        "summary": "Remove the enrolled authenticator",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/webauthn": {
      "get": {
        "tags": [
          "mfa"
        ],
        "summary": "The caller's registered passkeys / security keys",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "kind",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "passkey",
                              "security_key"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "lastUsedAt": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/webauthn/register/options": {
      "post": {
        "tags": [
          "mfa"
        ],
        "summary": "Begin passkey/security-key registration → ceremony options + challenge token",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "passkey",
                      "security_key"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Creation options + signed challenge token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "options",
                    "token"
                  ],
                  "properties": {
                    "options": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "PublicKeyCredentialCreationOptionsJSON"
                    },
                    "token": {
                      "type": "string",
                      "description": "Signed registration challenge token"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/webauthn/register/verify": {
      "post": {
        "tags": [
          "mfa"
        ],
        "summary": "Complete passkey/security-key registration",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "response"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Registration challenge token"
                  },
                  "response": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "RegistrationResponseJSON"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/mfa/webauthn/{id}": {
      "delete": {
        "tags": [
          "mfa"
        ],
        "summary": "Remove a registered passkey / security key",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/presence": {
      "get": {
        "tags": [
          "presence"
        ],
        "summary": "Look up the presence of specific users",
        "description": "Returns one entry per requested id. The caller always sees their own true state; every other id is visibility-gated, and one the caller may not see reports `online: false, lastSeenAt: null` — indistinguishable from genuinely offline.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "userIds",
            "in": "query",
            "required": false,
            "description": "The users to look up. Repeat the parameter, comma-separate the values, or both. At most 100 *distinct* ids — the cap is applied after de-duplication, so a longer list that collapses to 100 or fewer is accepted. Omitted means an empty result.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Presence for the requested users",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresenceList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/presence/heartbeat": {
      "post": {
        "tags": [
          "presence"
        ],
        "summary": "Refresh the caller's last-seen timestamp",
        "description": "Marks the caller active now. Takes no body — any body sent is ignored. This only moves `lastSeenAt`; whether a user counts as *online* is driven by their open streaming connections, not by this call.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresenceHeartbeatResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/privacy": {
      "get": {
        "tags": [
          "account"
        ],
        "summary": "List the caller's per-row privacy grants (optionally one target table)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "targetTable",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The caller’s privacy grants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PrivacyGrant"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "account"
        ],
        "summary": "Set one card row's audience (upsert; PUBLIC/HUB only, 0 = only-me)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "targetTable",
                  "targetId",
                  "audienceMask"
                ],
                "properties": {
                  "targetTable": {
                    "type": "string",
                    "enum": [
                      "avatar",
                      "social_links",
                      "addresses",
                      "contact_methods"
                    ]
                  },
                  "targetId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "audienceMask": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Bitmask of audiences: 1=PUBLIC, 2=HUB (or their OR, 3). 0 = only-me. TEAM/ORG/AI bits are rejected with 400."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stored grant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivacyGrant"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects": {
      "parameters": [
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to): the list pins to rows the principal OWNS, and a create stamps it as the owner. Omitted: the caller’s reach (owned / org / participating). Unknown/foreign slug: 404."
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List the projects in the caller's reach (non-deleted, oldest first)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Projects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Project"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Create a project (seeds default statuses + a project.created activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string"
                  },
                  "color": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20
                  },
                  "ecosystemId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "the owning ecosystem; defaulted to the caller ecosystem when omitted. A non-admin passing a foreign owner is rejected by RLS."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Get a project",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Update a project (+ a project.updated activity)",
        "description": "Requires the project’s projects item U verb. A patch that changes nothing is a true no-op: no write, no updated_at bump, and no project.updated{changed:[]} row.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50
                  },
                  "color": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20
                  },
                  "archivedAt": {
                    "type": "string",
                    "maxLength": 40,
                    "nullable": true,
                    "description": "an ISO timestamp archives; null un-archives"
                  },
                  "estimateScale": {
                    "type": "string",
                    "enum": [
                      "none",
                      "points",
                      "fibonacci",
                      "exponential",
                      "linear",
                      "tshirt"
                    ],
                    "description": "which estimate vocabulary this board writes in. Changing it NEVER invalidates an estimate already stored — the column takes any non-negative integer whatever the scale is — so this is safe to switch mid-flight. 'none' turns estimating off."
                  },
                  "priorityScale": {
                    "type": "string",
                    "enum": [
                      "standard",
                      "none"
                    ],
                    "description": "whether this board ranks its work. Safe to switch for the same reason as the scale above: 'none' hides the priority control and the priority column and keeps every rank already recorded, so turning ranking back on restores the order rather than an empty one."
                  },
                  "itemNoun": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32,
                    "description": "what this board calls ONE of its items, e.g. 'recipe'. Lower case by convention — the client capitalises where a sentence needs it, and a stored 'Recipe' would read as 'Delete 3 Recipes'."
                  },
                  "itemNounPlural": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32,
                    "description": "what this board calls MANY, e.g. 'recipes'. Accepted on its OWN, unlike in a template body: this patch edits words the board already has, so correcting a plural the client guessed ('storys') is a real request rather than half a rename."
                  },
                  "keyPrefix": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 8,
                    "description": "the prefix this board's keys render from. Upper-cased before it is checked, so `adh` and `ADH` are not two claims on the same prefix; 409 if another live board of the same owner already holds it. Renaming it re-renders every key at once — which is why the prefix is stored here and not on each card."
                  },
                  "startDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "nullable": true,
                    "description": "null clears it — a project that turns out to have no committed start must be able to say so again"
                  },
                  "targetDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "nullable": true,
                    "description": "null clears it. The pair is checked as it WILL BE, not as it was sent, so moving one end of a dated project is an ordinary one-key edit; 400 if the target would precede the start."
                  },
                  "leadKind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "persona",
                      "team"
                    ],
                    "nullable": true,
                    "description": "set WITH leadId, or send both as null to clear. A half — a kind naming nobody, or an id with no kind — is a 400 here rather than the projects_lead_kind_chk violation it would otherwise become."
                  },
                  "leadId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true
                  },
                  "programId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true,
                    "description": "a live program of this project's OWN workspace (400 otherwise — the same relational rule a card's iteration follows); null takes the board out of its program"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Soft-delete a project (+ a project.deleted activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/iterations": {
      "parameters": [
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to): the list pins to that principal’s iterations, and a create stamps it as the owner. Omitted: the caller’s reach. Unknown/foreign slug: 404."
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List the time-boxes in the caller's reach (non-deleted, in calendar order)",
        "description": "Every state is returned — upcoming, active and completed — because a cycle review needs the box that just closed as much as the one now open. The `state` on each row is derived against ONE `today` for the whole page, so a list can never straddle midnight and report two different instants.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Iterations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectIteration"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Create a time-box in the workspace",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "startDate",
                  "endDate"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "unique among the workspace’s live iterations (409 otherwise)"
                  },
                  "description": {
                    "type": "string"
                  },
                  "startDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "date (YYYY-MM-DD)"
                  },
                  "endDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "date (YYYY-MM-DD); both ends are inclusive, so startDate === endDate is a legal one-day box"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created iteration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectIteration"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/iterations/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Get a time-box + its derived state",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Iteration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectIteration"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Rename a time-box or move either end of it",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one field is required (a no-op patch is a 400). The dates are checked as the pair they WILL BE, not as the pair sent, so pushing only `endDate` out is an ordinary edit.",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string"
                  },
                  "startDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "endDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Iteration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectIteration"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Soft-delete a time-box, UN-ASSIGNING every card committed to it",
        "description": "Unlike deleting a board column — which is refused while any card sits in it, because `statusId` is NOT NULL and there would be no answer to give — this always succeeds: `iterationId` is nullable and \"no iteration\" IS the backlog, an ordinary state. The cards are swept back there rather than deleted, and the response is the COUNT of them, never the cards themselves. Requires the workspace’s projects D verb.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted; the cards returned to the backlog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "unassigned"
                  ],
                  "properties": {
                    "unassigned": {
                      "type": "integer",
                      "description": "how many cards were returned to the backlog"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/iterations/{id}/work-items": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "The cards committed to one time-box, across every board in the workspace",
        "description": "The iteration board. UNLIKE the delete and rollover sweeps — which act on the box and report a count — this READS content, so it IS filtered by the caller’s project reach: a card in a board this caller cannot open does not appear here just because they can see the cycle it is in.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Work items (in board order)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IterationWorkItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/iterations/{id}/rollover": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Close a cycle: move what did not finish into the next box (or the backlog)",
        "description": "\"Did not finish\" is read from each card’s status CATEGORY, never from a list of status keys — a board may call its terminal column anything, and `done`/`canceled` are the two categories that mean out of play. Everything else moves, `backlog` included: a card nobody started is exactly what rolls over. Both boxes are loaded through the same reach and U-verb gates, so a rollover can never push cards into an iteration the caller could not otherwise write to.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "toIterationId"
                ],
                "properties": {
                  "toIterationId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true,
                    "description": "where the unfinished cards go. An iteration in the SAME workspace (never this one), or null to send them back to the backlog — which is the honest destination when the next cycle does not exist yet."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rolled over",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "moved",
                    "toIterationId"
                  ],
                  "properties": {
                    "moved": {
                      "type": "integer",
                      "description": "how many unfinished cards were moved"
                    },
                    "toIterationId": {
                      "type": "string",
                      "nullable": true,
                      "description": "where they went; null = the backlog"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/programs": {
      "parameters": [
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to): the list pins to that principal’s programs, and a create stamps it as the owner. Omitted: the caller’s reach. Unknown/foreign slug: 404."
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List the programs in the caller's reach (non-deleted, by name)",
        "description": "Ordered by name, case-folded — a program list is a picker, and a byte-wise sort would put \"Zebra\" before \"apple\". NOT by date: most programs have none.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Programs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectProgram"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Create a program in the workspace",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "unique among the workspace’s live programs (409 otherwise)"
                  },
                  "description": {
                    "type": "string"
                  },
                  "color": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20
                  },
                  "startDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "nullable": true,
                    "description": "date (YYYY-MM-DD); optional, UNLIKE an iteration — a program need not be a time-box"
                  },
                  "targetDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "nullable": true,
                    "description": "date (YYYY-MM-DD); 400 if it precedes startDate"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created program",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectProgram"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/programs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Get a program",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Program",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectProgram"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Rename a program, recolour it, or move either of its dates",
        "description": "Requires the workspace’s projects U verb.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Every key is optional and a patch that changes nothing returns the program unchanged. Either date may be sent as null to CLEAR it; the pair is checked as it WILL BE.",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string"
                  },
                  "color": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20
                  },
                  "startDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "nullable": true
                  },
                  "targetDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Program",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectProgram"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Soft-delete a program, UN-ASSIGNING every project in it",
        "description": "The iteration-delete rule, applied one level up: `programId` is nullable and \"in no program\" is an ordinary state, so removing the container has a defined outcome. Refusing instead would strand the workspace behind a program it had to empty by hand, one board at a time. The sweep is NOT reach-filtered — the authority is the workspace D verb, and half-emptying it would leave boards pointing at a container nothing can show — so the response is a COUNT, never the boards. Requires the workspace’s projects D verb.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted; the boards left the program",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "unassigned"
                  ],
                  "properties": {
                    "unassigned": {
                      "type": "integer",
                      "description": "how many boards were taken out of it"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/programs/{id}/projects": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "The boards under one program, each with its derived health",
        "description": "The roll-up the program exists to make answerable — and it is a LIST, not a verdict: a program spanning a green board and a red one is not \"amber\", and inventing that word here would hide the one board somebody needs to look at. UNLIKE the delete sweep this READS content, so it IS filtered by the caller’s project reach: a board this caller cannot open does not appear just because they can see its program.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Projects (by name)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Project"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/templates": {
      "parameters": [
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE’s owning principal (the caller’s own customer slug, or an organization the caller belongs to): the list pins to that principal’s templates, and a create stamps it as the owner. Omitted: the caller’s reach. Unknown/foreign slug: 404."
        },
        {
          "name": "kind",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Only templates of this kind (`work_item` | `project`). A value outside the vocabulary is a 400, not an ignored param: the two kinds make different things, so answering \"all templates\" to a request for one of them hands a picker rows that will 400 the moment one is chosen."
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List the templates in the caller's reach (non-deleted, by name)",
        "description": "Ordered by name, case-folded — this list is a picker, like the programs list. Capped lower than the other pickers (200) because every row carries its BODY, which is the one thing a chooser has to preview and the one thing that makes a template row big.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectTemplate"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Create a template in the workspace",
        "description": "The body is validated against `kind` before it is stored, STRICTLY: an unrecognized key is a 400, because every key in a template body becomes something and silently dropping one would answer \"your template is fine\" and then build a board without the columns the author wrote. It is also what makes a kind mismatch detectable at all — a project body’s keys are all optional, so a work-item body sent under `kind: project` would otherwise be an empty-but-valid one. Requires the workspace’s projects C verb when creating into someone else’s workspace.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kind",
                  "name",
                  "body"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "work_item",
                      "project"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "unique among the workspace’s live templates OF THIS KIND (409 otherwise)"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "body": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/WorkItemTemplateBody"
                      },
                      {
                        "$ref": "#/components/schemas/ProjectTemplateBody"
                      }
                    ],
                    "description": "must match `kind` (400 otherwise), and must serialize to at most 16384 bytes. Validated STRICTLY — unlike a saved view’s opaque `config`, every key here BECOMES something, so an unrecognized one is refused rather than silently dropped."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/templates/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Get a template",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectTemplate"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Rename a template, re-describe it, or replace its body",
        "description": "Requires the workspace’s projects U verb. A replaced body is validated against the STORED kind, which no patch can change.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Every key is optional and a patch that changes nothing returns the template unchanged. There is no `kind`: what a template makes is its identity.",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "body": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/WorkItemTemplateBody"
                      },
                      {
                        "$ref": "#/components/schemas/ProjectTemplateBody"
                      }
                    ],
                    "description": "replaces the stored body outright; validated against the STORED kind"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Soft-delete a template",
        "description": "Nothing cascades. What a template MADE is ordinary rows that stopped being related to it the instant they were written — a board does not become invalid because the shape it was stamped from was retired. The soft delete exists so the name frees up for re-use. Requires the workspace’s projects D verb.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/templates/{id}/work-items": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Build a card (and its sub-tasks) from a work_item template",
        "description": "The template supplies the WORDS; the request supplies the PLACE. Each card written is an ordinary create — same row, same labels, same `work_item.created` activity, same assignment notification — and one extra `work_item.instantiated` row on the parent names the template, once, rather than under every child. The children inherit the parent’s column, plan point and cycle: a checklist’s steps belong to the same delivery as the thing they are steps of. Requires projects C (subitem) on the TARGET board; 400 if the template’s kind is `project`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId"
                ],
                "description": "Where the card LANDS — the board-local half a template body deliberately does not carry.",
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "the board to build on; the caller needs projects C (subitem) there"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "overrides the body’s title for THIS card only. The children are never re-titled — renaming a checklist’s steps at instantiation is editing the template, not using it."
                  },
                  "statusId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "a status of this project; omitted uses the lowest-position column"
                  },
                  "milestoneId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "a live milestone of THIS project (400 otherwise)"
                  },
                  "iterationId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "a live iteration of this project's OWNER (400 otherwise)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created card and its children",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "item",
                    "children"
                  ],
                  "properties": {
                    "item": {
                      "$ref": "#/components/schemas/WorkItem"
                    },
                    "children": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WorkItem"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/templates/{id}/projects": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "The workspace the NEW BOARD is created in — which need not be the one the template lives in. Omitted: the caller’s own. Creating into someone else’s requires the projects C verb there."
        }
      ],
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Build a board (columns, estimate scale, plan) from a project template",
        "description": "The columns and estimate scale go THROUGH the one project writer, so the board is never observable holding columns it was not meant to have, and its milestones are inserted in the same transaction. A `project.instantiated` activity row names the template. 400 if the template’s kind is `work_item`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "the new board’s name — the one thing a project template never stores. Its key prefix is ALLOCATED from it, exactly as a plain POST /project/projects does."
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 10000,
                    "description": "wins over the body’s description, which is the template author’s fallback"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created board and its seeded plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "project",
                    "milestones"
                  ],
                  "properties": {
                    "project": {
                      "$ref": "#/components/schemas/Project"
                    },
                    "milestones": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectMilestone"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/stream": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Server-sent wake stream for one board",
        "description": "Opens an SSE stream that emits a payload-less `project` event ({}) each time anything on this board changes, so an open client refetches through the ordinary routes it already uses. The event deliberately carries NO data and NO kind: the stream is held open outside any tenant transaction, so the sending side has no caller to authorize a row against — a wake that carries nothing cannot leak anything. Several changes made by one gesture arrive as ONE event. Closes after 5 minutes; reconnect. When the server has no push channel configured it emits a single `ready` event instead and closes, and the client falls back to polling. Reachability is checked before the stream opens (404 for a board the caller cannot read), and — uniquely among Projects routes — the access token may be passed as `?access_token=`, because a browser EventSource cannot set the Authorization header.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "text/event-stream of payload-less board wake events"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/triage": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "One board's triage inbox (oldest first)",
        "description": "Full cards, in arrival order — a queue is worked from the end that has been waiting longest. Same reach as the board’s own list: no extra verb, because a card in the inbox is still a card on a board the caller can open.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Untriaged cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/triage": {
      "parameters": [
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope the queue to one WORKSPACE’s boards. Omitted: every board in the caller’s reach."
        },
        {
          "name": "limit",
          "in": "query",
          "required": false,
          "schema": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "description": "Page size; out-of-range values are CLAMPED rather than rejected, as on the search route. Bigger than a search page and smaller than a board: an inbox is worked through, so a page is a sitting’s worth of decisions, and a queue long enough to need the second page is itself the finding."
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Every reachable board's untriaged cards, oldest first",
        "description": "The surface someone clearing a queue actually wants, because an intake that spans boards is the case an inbox is for. Built on the same reachable-projects join the cross-project search uses, and carrying the same property: the bound IS the authorization, so there is no version of this query that reads a board the caller cannot open. Rows are thinner than a WorkItem — see TriageHit.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the queue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "results",
                    "limit",
                    "hasMore"
                  ],
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TriageHit"
                      }
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/triage": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Accept a card out of the inbox (+ a work_item.triaged activity)",
        "description": "Stamps `triagedAt` and applies any placement carried in the body. The placement goes through the same writer a PATCH uses — so it validates its ids and records its own activity identically — and the stamp is appended after it rather than folded in: `triagedAt` is not a patchable field, and nothing un-accepts a card. IDEMPOTENT on the stamp: accepting an already-accepted card applies the placement and leaves the original timestamp alone, because when a card left the queue has one answer and a double-click must not rewrite it. Requires projects U (subitem) on the board. Addressable by uuid OR rendered key (`ADH-42`).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Accepting a card out of the inbox, with the placement carried in the same request. Every key is optional — accepting a card that is already where it belongs is the common case — and each is applied through the same writer a PATCH uses, so it validates and records identically. There is no `decline`: declining is naming a status in the `canceled` category, which leaves the card findable in a column that says what happened to it.",
                "properties": {
                  "statusId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "assigneeKind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "persona",
                      "team"
                    ]
                  },
                  "assigneeId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "milestoneId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "iterationId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4,
                    "description": "rank, 0 (none) to 4 (urgent); higher is more urgent"
                  },
                  "estimate": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The accepted card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItem"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/statuses": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List a project's board columns (by position)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Statuses",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectStatus"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Add a board column (+ a status.created activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "label",
                  "category"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "backlog",
                      "todo",
                      "in_progress",
                      "done",
                      "canceled"
                    ]
                  },
                  "position": {
                    "type": "integer",
                    "description": "explicit column order; defaults to append (max+1)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectStatus"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/statuses/{statusId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "statusId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Rename / recategorize / reorder a column (+ a status.updated activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "backlog",
                      "todo",
                      "in_progress",
                      "done",
                      "canceled"
                    ]
                  },
                  "position": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectStatus"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Remove a column (+ a status.deleted activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/saved-views": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List a project's saved views (by name)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Saved views",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectSavedView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Save a view (+ a saved_view.created activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "config"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "config": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "opaque client-defined view config (view id, filter, sort). Stored whole, never interpreted; must be a JSON object and serialize to at most 8192 bytes."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created saved view",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectSavedView"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/saved-views/{viewId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "viewId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Rename a saved view / re-point it at the current filter (+ a saved_view.updated activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "config": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "opaque client-defined view config (view id, filter, sort). Stored whole, never interpreted; must be a JSON object and serialize to at most 8192 bytes."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved view",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectSavedView"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Delete a saved view (+ a saved_view.deleted activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/milestones": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List a project's milestones, each with its live card counts",
        "description": "Plan order — by targetDate ascending, with the UNDATED last. An undated milestone is the one a reader most needs to find at a predictable end of the list, so where it lands is part of the contract rather than a default anyone should have to discover.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Milestones",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectMilestone"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Add a milestone (+ a milestone.created activity)",
        "description": "Requires the project’s projects sub-item C verb. The response carries `counts` as all-zeros rather than omitting it — the shape a create returns is the shape the list returns.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "unique among the project’s live milestones (409 otherwise)"
                  },
                  "description": {
                    "type": "string"
                  },
                  "targetDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "nullable": true,
                    "description": "date (YYYY-MM-DD); omitted leaves the milestone undated, which is a real state and not a missing one"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created milestone",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectMilestone"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/milestones/{milestoneId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "milestoneId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Rename a milestone or move its date (+ a milestone.updated activity)",
        "description": "Requires the project’s projects sub-item U verb. The milestone is looked up BY PROJECT as well as by id, so a milestoneId belonging to another board is a 404 rather than a silent cross-project edit.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one field is required (a no-op patch is a 400). A null targetDate un-dates it.",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string"
                  },
                  "targetDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Milestone (without counts — the list recomputes them)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectMilestone"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Soft-delete a milestone, UN-ASSIGNING its cards (+ a milestone.deleted activity)",
        "description": "The iteration-delete rule at project scope: `milestoneId` is nullable and \"counts toward no milestone\" is an ordinary state, so this always succeeds and the cards are detached rather than deleted. The sweep is bounded to THIS project — a milestone’s cards cannot be anywhere else — which also keeps it from touching a row the caller’s D verb here does not cover. Requires the project’s projects sub-item D verb.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted; the cards were detached",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "unassigned"
                  ],
                  "properties": {
                    "unassigned": {
                      "type": "integer",
                      "description": "how many cards were detached"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/status-updates": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "A project's status reports, NEWEST FIRST (up to 100)",
        "description": "The opposite order to a comment thread, and deliberately: a thread is read as a conversation from the start, whereas the only report anyone opens a project for is the current one. The tie-break on a same-instant pair is the same one the health derivation uses, so the row at the top of this list is always the row that decided `Project.health`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Status updates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectStatusUpdate"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Post a status update — this MOVES the project's health",
        "description": "Requires the project’s projects sub-item C verb. The new report becomes the newest, so `Project.health` reads from it on the very next project fetch. The author is the acting principal (a persona’s report is the persona’s) and is never re-written afterwards.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "health",
                  "body"
                ],
                "properties": {
                  "health": {
                    "type": "string",
                    "enum": [
                      "on_track",
                      "at_risk",
                      "off_track"
                    ],
                    "description": "required WITH the prose: a health with no explanation is a colour nobody can act on"
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000,
                    "description": "required WITH the health: prose that moves no dashboard is a comment, not a report"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Posted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectStatusUpdate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/status-updates/{updateId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "updateId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Revise a status update — AUTHOR ONLY (+ a status_update.edited activity)",
        "description": "The comment rule, for the identical reason: a status update carries the reporter’s name, so rewriting someone else’s is a forgery — and this one would additionally move a dashboard. No verb grants otherwise; a platform admin is the sole exception, and only because they can already reach the row by other means. The activity records the PREVIOUS health, because an edit that flipped a board from on-track to off-track is a different event from a typo fix and only the old value can tell them apart.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one field is required (a no-op patch is a 400). AUTHOR ONLY — 403 for anyone else, whatever verbs they hold on the project, because a status update carries the reporter’s name.",
                "properties": {
                  "health": {
                    "type": "string",
                    "enum": [
                      "on_track",
                      "at_risk",
                      "off_track"
                    ]
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectStatusUpdate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Retract a status update (+ a status_update.deleted activity)",
        "description": "The author may always retract their own report; anyone holding the project’s projects sub-item D verb may remove someone else’s — a removal is not a forgery. Retracting the NEWEST report moves the project’s health back to whatever the previous live update said, or to null. That is the honest outcome of withdrawing a claim, and the reason health is derived rather than stored: a column would still be asserting this row’s health with nothing left to explain it.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Retracted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/participants": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List a project's participants (by addedAt)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Participants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectParticipant"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Attach a customer / persona / team (+ a participant.added activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "participantKind",
                  "participantId"
                ],
                "properties": {
                  "participantKind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "persona",
                      "team"
                    ]
                  },
                  "participantId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added participant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectParticipant"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/participants/{participantId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "participantId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Detach a participant by (kind, entity-id) (+ a participant.removed activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/fields": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List a project's custom fields (by position)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Fields",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectField"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Add a custom field (+ a field.created activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "label",
                  "type"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "number",
                      "date",
                      "select",
                      "user",
                      "checkbox"
                    ]
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "required (non-empty) for a select field; omitted for every other type"
                  },
                  "position": {
                    "type": "integer",
                    "description": "explicit field order; defaults to append (max+1)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created field",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectField"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/fields/{fieldId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "fieldId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Relabel / retype / reorder a field (+ a field.updated activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one mutable field is required (a no-op patch is a 400). `key` is immutable.",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "number",
                      "date",
                      "select",
                      "user",
                      "checkbox"
                    ]
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "nullable": true,
                    "description": "null clears the list; a select field requires a non-empty list on the effective (post-patch) type"
                  },
                  "position": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Field",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectField"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Remove a field (cascades its stored values; + a field.deleted activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/labels": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "The label vocabulary this project's cards draw on",
        "description": "Every live label the project's OWNING principal has used — on a research document as readily as on a card, because both sides use the one tagging system (content.keywords). Distinct and alphabetical: the autocomplete/browse source for a card's labels field.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Distinct labels, sorted alphabetically",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StringList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/search/work-items": {
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Search the caller's work items across every board they reach",
        "description": "The cross-board read: given a phrase, the cards that match it anywhere in the caller’s reach, ranked. A query shaped like a rendered KEY (`ADH-42`) additionally matches that card by key and sorts it FIRST, because someone who typed a key named a row rather than described one. Reach is the same one the projects list uses (owned / owning-organization / participating), and it is what BOUNDS the query — a caller with no reach gets nothing, by construction rather than by filter. For text inside ONE board, filter the board’s own list client-side; this route exists for the question that list cannot be asked.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Narrow to one WORKSPACE’s boards (the caller’s own customer slug, or an organization they belong to). Omitted: the caller’s whole reach. Unknown/foreign slug: 404."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            },
            "description": "Out-of-range values are CLAMPED rather than rejected — a search that answers nothing because a caller asked for 500 is the wrong failure. Small on purpose: a result list is read, not scrolled."
          }
        ],
        "responses": {
          "200": {
            "description": "Matching cards (ranked), with the board each is on",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "results",
                    "limit",
                    "hasMore"
                  ],
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WorkItemSearchHit"
                      }
                    },
                    "limit": {
                      "type": "integer",
                      "description": "the limit actually applied, after clamping"
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/work-items": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "includeUntriaged",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string",
            "enum": [
              "true"
            ]
          },
          "description": "Send `true` to include cards still sitting in the triage inbox (`triagedAt: null`), which the board list otherwise omits. Opt-in because the default has to be the one that cannot mislead: an untriaged card has had no column decision made about it, so listing it would show it in whatever column it happened to be filed into. Use it for an export or a count — for the queue itself, GET /project/projects/{id}/triage."
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List a project's ACCEPTED work items (non-deleted, in board order)",
        "description": "Cards awaiting triage are omitted unless `includeUntriaged=true`. On a board that has never used an intake queue this is every card, because a card created without `triage: true` is accepted at creation.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Work items",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Create a work item (refs validated in-project; + a work_item.created activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "description": {
                    "type": "string"
                  },
                  "statusId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "must be a status of this project; defaults to the lowest-position column"
                  },
                  "assigneeKind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "persona",
                      "team"
                    ]
                  },
                  "assigneeId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "set with assigneeKind (both or neither); must be a current participant"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4,
                    "description": "rank, 0 (none) to 4 (urgent); higher is more urgent"
                  },
                  "startDate": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "date (YYYY-MM-DD)"
                  },
                  "dueDate": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "date (YYYY-MM-DD)"
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "labels for the card; each is trimmed, blanks are dropped, and a repeat keeps its first position. A label not yet in the owner's vocabulary is created there."
                  },
                  "parentId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "a live work item in the same project (not self)"
                  },
                  "iterationId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "a live iteration of this project's OWNER (400 otherwise); omitted leaves the card in the backlog"
                  },
                  "milestoneId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "a live milestone of THIS project (400 otherwise — narrower than the iteration rule above, because a milestone is a point in one plan); omitted leaves the card counting toward none"
                  },
                  "estimate": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "the card’s size; omitted leaves it unestimated"
                  },
                  "triage": {
                    "type": "boolean",
                    "description": "file this card into the board’s TRIAGE INBOX instead of onto the board (`triagedAt` stays null and the board list omits it until someone accepts it). Defaults false, which is what keeps the inbox opt-in: an intake form or an integration sets it, and every other caller keeps the behaviour it has always had."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created work item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItem"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Get a work item (authorized via its parent project)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Work item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItem"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Update a work item (+ a work_item.status_changed | .assigned | .iteration_changed | .updated activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one mutable field is required (a no-op patch is a 400).",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "description": {
                    "type": "string"
                  },
                  "statusId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "assigneeKind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "persona",
                      "team"
                    ],
                    "nullable": true,
                    "description": "null clears the assignee (with assigneeId)"
                  },
                  "assigneeId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4,
                    "description": "rank, 0 (none) to 4 (urgent); higher is more urgent"
                  },
                  "startDate": {
                    "type": "string",
                    "maxLength": 10,
                    "nullable": true
                  },
                  "dueDate": {
                    "type": "string",
                    "maxLength": 10,
                    "nullable": true
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "replaces the card's whole label set (an empty array clears it)"
                  },
                  "parentId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true,
                    "description": "null detaches the parent"
                  },
                  "iterationId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true,
                    "description": "commits the card to a live iteration of its project's OWNER (400 otherwise); null returns it to the backlog"
                  },
                  "milestoneId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true,
                    "description": "points the card at a live milestone of ITS OWN project (400 otherwise); null detaches it from the plan"
                  },
                  "estimate": {
                    "type": "integer",
                    "minimum": 0,
                    "nullable": true,
                    "description": "null un-estimates the card — distinct from 0, which estimates it as trivial"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Work item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItem"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Soft-delete a work item (+ a work_item.deleted activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/move": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Reorder a card among its siblings (+ a work_item.moved activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Where the card goes, as the cards it lands between. `{afterId: X}` puts it directly below X, `{beforeId: X}` directly above X, `{afterId: null}` at the very top, `{beforeId: null}` at the very bottom. Naming neither is a 400, and so is nulling both — that describes a list with nothing else in it. Each neighbour must be a SIBLING (same project, same parent) — re-parenting is PATCH /project/work-items/{id}.",
                "properties": {
                  "afterId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true,
                    "description": "the card this one goes below (id or key); null = nothing above it"
                  },
                  "beforeId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true,
                    "description": "the card this one goes above (id or key); null = nothing below it"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Work item (with its new rank)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItem"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/children": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "A work item's direct children (non-deleted, in board order)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Child work items",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/fields": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "A work item's field form (every project field ⟕ its stored value)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Field values",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkItemFieldValue"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "project"
        ],
        "summary": "Set / clear a batch of field values (+ a work_item.fields_updated activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "values"
                ],
                "properties": {
                  "values": {
                    "type": "array",
                    "description": "a batch of set/clear operations, applied in payload order; ALL entries are validated before any write, so a bad entry fails the whole batch. An empty array is a legal no-op.",
                    "items": {
                      "type": "object",
                      "required": [
                        "fieldId",
                        "value"
                      ],
                      "properties": {
                        "fieldId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 36
                        },
                        "value": {
                          "nullable": true,
                          "description": "the value to store (must match the field's type), or null to clear it"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Field values (the reconciled form)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkItemFieldValue"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/dependencies": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "A work item's dependencies (joined to the depended-on item titles, by createdAt)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Dependencies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkItemDependency"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Add a dependency edge (+ a dependency.added activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "dependsOnId"
                ],
                "properties": {
                  "dependsOnId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "a live work item in the same project (not self; must not close a cycle)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created dependency edge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "ecosystemId",
                    "workItemId",
                    "dependsOnId",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "workItemId": {
                      "type": "string",
                      "description": "the dependent item (the path {id})"
                    },
                    "dependsOnId": {
                      "type": "string",
                      "description": "the work item it depends on"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/dependencies/{dependsOnId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "dependsOnId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Remove a dependency edge (+ a dependency.removed activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/relations": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Every live link touching this work item, both directions (by createdAt)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "depends_on",
                "duplicates",
                "relates_to"
              ]
            },
            "description": "Narrow to one relationship; omitted returns all. An unknown kind is a 400."
          }
        ],
        "responses": {
          "200": {
            "description": "Relations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkItemRelation"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Link this work item to another (+ a dependency.added activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "relatedId",
                  "kind"
                ],
                "properties": {
                  "relatedId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "a live work item in the same project (not self; must not already be linked to this one)"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "depends_on",
                      "duplicates",
                      "relates_to"
                    ],
                    "description": "which relationship this edge asserts; only depends_on is cycle-checked, because only it claims an order"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created relation edge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "ecosystemId",
                    "workItemId",
                    "dependsOnId",
                    "kind",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "workItemId": {
                      "type": "string",
                      "description": "the subject item (the path {id})"
                    },
                    "dependsOnId": {
                      "type": "string",
                      "description": "the object item — read as a prerequisite only for kind depends_on"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "depends_on",
                        "duplicates",
                        "relates_to"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/relations/{relatedId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "relatedId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Unlink two work items, from either end (+ a dependency.removed activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/research": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Mark this project as research (idempotent)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Marked as research",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "projectId",
                    "research"
                  ],
                  "properties": {
                    "projectId": {
                      "type": "string"
                    },
                    "research": {
                      "type": "boolean",
                      "description": "always true on success"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Un-mark this project as research",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Un-marked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/artifacts": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List a project's artifacts (newest first), optionally filtered by direction",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ingested",
                "produced"
              ]
            },
            "description": "Filter to ingested | produced; omitted (or any other value) returns both."
          }
        ],
        "responses": {
          "200": {
            "description": "Artifacts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectArtifact"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Link an ingested / produced artifact (idempotent on direction + target)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "direction",
                  "targetKind",
                  "targetId"
                ],
                "properties": {
                  "direction": {
                    "type": "string",
                    "enum": [
                      "ingested",
                      "produced"
                    ]
                  },
                  "targetKind": {
                    "type": "string",
                    "enum": [
                      "content.markdown",
                      "content.urls"
                    ],
                    "description": "the target's registry, e.g. 'content.markdown'. Must be a kind the target registry knows (400 otherwise), and the target itself must exist within the PROJECT owner's reach (404 otherwise) — an unreachable id is indistinguishable from an absent one. GET /project/projects/{id}/attachable lists the ids that will be accepted."
                  },
                  "targetId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Linked artifact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectArtifact"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/attachable": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Targets this project could attach — the candidate list an attach picker reads",
        "description": "Everything the project OWNER can reach, of every registered target kind (or one, via `kind`), most recently touched first. Returned through the same owner scope the link write checks against, so every row here is one POST /artifacts will accept. Requires the project 'C' verb — the same gate as the attach itself, so this is not a read-only route for enumerating a workspace.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "content.markdown",
                "content.urls"
              ]
            },
            "description": "Restrict to one target kind. Omit for every registered kind — which is how a client builds the picker without hard-coding the vocabulary. An unregistered value is a 400 naming the known set."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Free-text narrowing. Matches a document title, and for a saved URL either its title or the address it was saved as (so a not-yet-unfurled URL is still findable)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "Max rows PER KIND (not per response), so no one kind can crowd the others out of the picker. Default 20, max 100; a non-numeric or out-of-range value is clamped."
          }
        ],
        "responses": {
          "200": {
            "description": "Attachable targets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TargetDescriptor"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/artifacts/{artifactId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "artifactId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Un-link an artifact (soft delete; the target can be re-linked)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Un-linked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/projects/{id}/activity": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "A project's activity trail (newest first, keyset-paginated)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beforeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectActivity"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/activity": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "A work item's activity trail (newest first, keyset-paginated)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beforeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectActivity"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/work-items/{id}/comments": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "A work item's comments, oldest first (the order a conversation is read in)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Comments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectComment"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Add a comment to a work item (also appends a comment.added activity)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "body"
                ],
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000
                  },
                  "parentId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true,
                    "description": "reply to this comment. Must be a comment on the SAME work item (400 otherwise); a reply to a reply is stored against that reply's root, so threads stay one level deep"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created comment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectComment"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/comments/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "project"
        ],
        "summary": "Rewrite a comment's body (author only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "body"
                ],
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated comment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectComment"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Remove a comment (soft delete; appends comment.deleted)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/global": {
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Create a global (persona-scope) memory",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "personaId",
                  "slug",
                  "memoryType",
                  "description",
                  "body"
                ],
                "properties": {
                  "personaId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "memoryType": {
                    "type": "string",
                    "enum": [
                      "user",
                      "feedback",
                      "project",
                      "reference"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1
                  },
                  "subjectTable": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "subjectId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "inferred",
                      "user_stated",
                      "tool"
                    ]
                  },
                  "confidence": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created global memory",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaMemory"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/recall": {
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Keyword, semantic or combined recall of a persona’s memories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "personaId",
                  "query"
                ],
                "properties": {
                  "personaId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "query": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "memoryType": {
                    "type": "string",
                    "enum": [
                      "user",
                      "feedback",
                      "project",
                      "reference"
                    ]
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "keyword",
                      "semantic",
                      "combined"
                    ],
                    "default": "combined",
                    "description": "`keyword` needs no embedder; `semantic` fails with 503/502 when it cannot embed; `combined` falls back to keyword hits alone"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ranked memory matches",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaMemoryRecallResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/services": {
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "List the caller's LLM provider connections",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Persona services (redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PersonaService"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Create an LLM provider connection",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "providerKind",
                  "baseUrl"
                ],
                "properties": {
                  "templateId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "providerKind": {
                    "type": "string",
                    "enum": [
                      "openai",
                      "anthropic",
                      "gemini",
                      "external"
                    ]
                  },
                  "baseUrl": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "apiKey": {
                    "type": "string",
                    "description": "Plaintext provider key; stored, never returned"
                  },
                  "connectionSpec": {
                    "$ref": "#/components/schemas/ProviderConnectionSpec"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Persona service (redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaService"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/services/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "Get an LLM provider connection by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Persona service (redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaService"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "persona"
        ],
        "summary": "Update an LLM provider connection",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "baseUrl": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "apiKey": {
                    "type": "string",
                    "description": "Plaintext provider key; stored, never returned"
                  },
                  "connectionSpec": {
                    "$ref": "#/components/schemas/ProviderConnectionSpec"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persona service (redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaService"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona"
        ],
        "summary": "Delete an LLM provider connection",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/services/{id}/connect": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Test the connection — probe the provider, persist status + cache the catalog",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Persona service (redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaService"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/services/{id}/models": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "Live provider model catalog — fetched fresh, not persisted",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Live provider model catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PersonaServiceModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/services/{id}/models/refresh": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Re-fetch + persist the provider catalog (probes the provider, like connect)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Persona service (redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaService"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/provider-templates": {
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "List/search LLM provider templates (public; ?q= substring on name/kind, ?providerKind= exact, paginated)",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "providerKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Provider templates with their models",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderTemplateList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Create a provider template with its models in one call (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "providerKind",
                  "name",
                  "baseUrl"
                ],
                "properties": {
                  "providerKind": {
                    "type": "string",
                    "enum": [
                      "openai",
                      "anthropic",
                      "gemini",
                      "external"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "baseUrl": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "documentationUrl": {
                    "type": "string",
                    "maxLength": 500,
                    "nullable": true
                  },
                  "statusUrl": {
                    "type": "string",
                    "maxLength": 500,
                    "nullable": true
                  },
                  "connectionSpec": {
                    "$ref": "#/components/schemas/ProviderConnectionSpec"
                  },
                  "syncKeys": {
                    "$ref": "#/components/schemas/TemplateSyncKeys"
                  },
                  "availableVia": {
                    "$ref": "#/components/schemas/TemplateAvailableVia"
                  },
                  "modalities": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "chat",
                        "image",
                        "video"
                      ]
                    },
                    "nullable": true
                  },
                  "models": {
                    "type": "array",
                    "maxItems": 500,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "description": "Model names. On create: the initial model list. On update: the FULL desired set (matching rows kept, missing inserted, absent deleted); omit to leave models unchanged."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/provider-templates/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "One provider template with its models (public)",
        "responses": {
          "200": {
            "description": "Provider template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderTemplate"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "persona"
        ],
        "summary": "Update a provider template; optional full model-set sync (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "providerKind": {
                    "type": "string",
                    "enum": [
                      "openai",
                      "anthropic",
                      "gemini",
                      "external"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "baseUrl": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "documentationUrl": {
                    "type": "string",
                    "maxLength": 500,
                    "nullable": true
                  },
                  "statusUrl": {
                    "type": "string",
                    "maxLength": 500,
                    "nullable": true
                  },
                  "connectionSpec": {
                    "$ref": "#/components/schemas/ProviderConnectionSpec"
                  },
                  "syncKeys": {
                    "$ref": "#/components/schemas/TemplateSyncKeys"
                  },
                  "availableVia": {
                    "$ref": "#/components/schemas/TemplateAvailableVia"
                  },
                  "modalities": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "chat",
                        "image",
                        "video"
                      ]
                    },
                    "nullable": true
                  },
                  "models": {
                    "type": "array",
                    "maxItems": 500,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "description": "Model names. On create: the initial model list. On update: the FULL desired set (matching rows kept, missing inserted, absent deleted); omit to leave models unchanged."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona"
        ],
        "summary": "Delete a provider template and its models (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/provider-templates/{id}/verify": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Probe the live provider with a caller-supplied key — never stored — to verify kind/baseUrl speak the claimed contract (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apiKey"
                ],
                "properties": {
                  "apiKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Used for this one probe request only; not persisted."
                  },
                  "baseUrl": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Optional base_url override for the probe — supply a concrete URL to verify a template whose stored base_url still carries url-var placeholders."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Probe outcome (a failed probe is ok:false, not an error status)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderTemplateVerifyResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/provider-templates/sync": {
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Force a full catalog-sync round NOW, bypassing the TTL, and return per-source outcomes (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Per-source sync outcomes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "outcomes"
                  ],
                  "properties": {
                    "outcomes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CatalogSyncOutcome"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/provider-templates/sync-status": {
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "Last catalog-sync run per source (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Last sync run per source",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "sources"
                  ],
                  "properties": {
                    "sources": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CatalogSyncRun"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/provider-templates/{id}/sync-keys": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "The operator-only upstream sync mapping the public DTO omits (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sync keys (null when the template never syncs)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "syncKeys"
                  ],
                  "properties": {
                    "syncKeys": {
                      "$ref": "#/components/schemas/TemplateSyncKeys"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/personas/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a public persona by slug (oldest match)",
        "responses": {
          "200": {
            "description": "Public persona",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPersona"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/personas/{slug}/sheet": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a public persona's gamification character sheet",
        "responses": {
          "200": {
            "description": "Persona character sheet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaSheet"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/personas/{slug}/recap": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a public persona's weekly gamification recap (surface-gated)",
        "responses": {
          "200": {
            "description": "Persona weekly recap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaWeeklyRecap"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/boards/{statKey}": {
      "parameters": [
        {
          "name": "statKey",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Public hub leaderboard for one boardable stat (surface-gated)",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "rolling30",
                "allTime",
                "trending",
                "season"
              ],
              "default": "trending"
            },
            "description": "Ranking window (absent → trending). `season` ranks the hub realm’s current season; empty when the hub has no season config."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked board of public personas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationBoard"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/boards/{statKey}/leagues": {
      "parameters": [
        {
          "name": "statKey",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Public hub league cohort of the current season board (surface-gated)",
        "parameters": [
          {
            "name": "league",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Zero-based league cohort of the current season board (30 ranks each, by season standing; absent → 0). Entries keep their GLOBAL season rank; empty when the hub has no season config."
          }
        ],
        "responses": {
          "200": {
            "description": "One league cohort of public personas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GamificationLeague"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/users/{ownerSlug}/personas/{personaSlug}": {
      "parameters": [
        {
          "name": "ownerSlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "personaSlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a public persona scoped to its owner",
        "responses": {
          "200": {
            "description": "Public persona",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPersona"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/users/search": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Search visible user and organization profiles by slug or display name",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching principals visible to the caller (max 20)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicUserSearchHit"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/public/users/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a public user profile card and its public personas",
        "responses": {
          "200": {
            "description": "Public user profile card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicUserProfile"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/users/{slug}/sheet": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a user's creator gamification character sheet",
        "responses": {
          "200": {
            "description": "Creator character sheet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubjectSheet"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/orgs/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get an organization profile card and its public personas",
        "responses": {
          "200": {
            "description": "Public organization profile card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrgProfile"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/orgs/{ownerSlug}/personas/{personaSlug}": {
      "parameters": [
        {
          "name": "ownerSlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "personaSlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a public persona scoped to its owning organization",
        "responses": {
          "200": {
            "description": "Public persona",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPersona"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/orgs/{slug}/sheet": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get an organization's member-aggregate gamification character sheet",
        "responses": {
          "200": {
            "description": "Organization character sheet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgSheet"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/users/{slug}/papers": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "List an author's published papers (metadata only)",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Free-text query matched across title, body, category, and tags."
          }
        ],
        "responses": {
          "200": {
            "description": "Published papers (metadata only), newest-updated first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PublicPaperSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/users/{slug}/papers/{route}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "route",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a published paper by (author slug, route)",
        "responses": {
          "200": {
            "description": "The published paper (with content)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPaper"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/papers": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Search published papers across ALL authors (metadata + snippet)",
        "description": "Cross-author search over PUBLISHED, non-deleted markdown. `q` is a case-insensitive substring matched across title, body, category name, and tag labels; `tag` and `category` are exact-match filters. Each hit carries author attribution, the public route, classification, and a ~200-char match-context snippet — never the full body.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Free-text query matched across title, body, category, and tags."
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Restrict to papers whose tag set contains this exact tag."
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Restrict to papers with this exact category."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of cross-author paper hits, newest-updated first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "page",
                    "pageSize"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PublicPaperSearchHit"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/public/papers/tags": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Distinct tag labels used by published papers (cross-author facet source)",
        "responses": {
          "200": {
            "description": "Distinct tag labels, sorted alphabetically",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StringList"
                }
              }
            }
          }
        }
      }
    },
    "/public/papers/categories": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Distinct category names used by published papers (cross-author facet source)",
        "responses": {
          "200": {
            "description": "Distinct category names, sorted alphabetically",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StringList"
                }
              }
            }
          }
        }
      }
    },
    "/public/registries": {
      "parameters": [
        {
          "name": "page",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "pageSize",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "List the public registries, alphabetical by name",
        "responses": {
          "200": {
            "description": "A page of public registries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRegistryDirectory"
                }
              }
            }
          }
        }
      }
    },
    "/public/registries/{registrySlug}": {
      "parameters": [
        {
          "name": "registrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a registry by slug, with its sections and public field defs",
        "responses": {
          "200": {
            "description": "Registry metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRegistry"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/registries/{registrySlug}/entries": {
      "parameters": [
        {
          "name": "registrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "page",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "pageSize",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Browse a registry’s published, public entries (newest first)",
        "responses": {
          "200": {
            "description": "A page of public entries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRegistryEntryList"
                }
              }
            }
          }
        }
      }
    },
    "/public/registries/{registrySlug}/search": {
      "parameters": [
        {
          "name": "registrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "q",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "category",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "deliveryMode",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "pricingModel",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Match entries with at least one non-deleted service at this pricing model."
        },
        {
          "name": "page",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "pageSize",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Full-text search a registry’s published, public entries",
        "responses": {
          "200": {
            "description": "A page of matching public entries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRegistryEntryList"
                }
              }
            }
          }
        }
      }
    },
    "/public/registries/{registrySlug}/entries/{entrySlug}": {
      "parameters": [
        {
          "name": "registrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "entrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get one public entry by slug (301s a superseded slug)",
        "responses": {
          "200": {
            "description": "The entry, its parent registry summary, and its JSON-LD",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRegistryEntryResponse"
                }
              }
            }
          },
          "301": {
            "description": "The slug was renamed; Location points at the current one"
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/registries/{registrySlug}/sitemap": {
      "parameters": [
        {
          "name": "registrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "List every public entry slug in a registry, for a sitemap",
        "responses": {
          "200": {
            "description": "Public entry slugs, alphabetical",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRegistrySitemap"
                }
              }
            }
          }
        }
      }
    },
    "/users/search": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Search visible user and organization profiles as a signed-in viewer ('public' + 'hub')",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching principals ('public' + 'hub' profiles, max 20)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicUserSearchHit"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a user card as a signed-in viewer (HUB + PUBLIC rows)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "User profile card (HUB + PUBLIC rows)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicUserProfile"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orgs/{slug}": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get an organization card as a signed-in viewer ('public' + 'hub' orgs)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization profile card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrgProfile"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/{ownerSlug}/personas/{personaSlug}": {
      "parameters": [
        {
          "name": "ownerSlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "personaSlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a persona scoped to its owning user as a signed-in viewer ('public' + 'hub')",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Persona (public + hub rows)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPersona"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orgs/{ownerSlug}/personas/{personaSlug}": {
      "parameters": [
        {
          "name": "ownerSlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "personaSlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a persona scoped to its owning organization as a signed-in viewer ('public' + 'hub')",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Persona (public + hub rows)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPersona"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registries/{registrySlug}": {
      "parameters": [
        {
          "name": "registrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get a registry as a signed-in viewer ('public' + 'hub' registries)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Registry metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRegistry"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registries/{registrySlug}/entries/{entrySlug}": {
      "parameters": [
        {
          "name": "registrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "entrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Get one entry as a signed-in viewer (public + authenticated fields, 'hub' rows)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The entry, its parent registry summary, and its JSON-LD",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRegistryEntryResponse"
                }
              }
            }
          },
          "301": {
            "description": "The slug was renamed; Location points at the current one"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/personas/{slug}/visitor-tokens": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The public persona's slug"
        }
      ],
      "post": {
        "tags": [
          "public"
        ],
        "summary": "Mint an anonymous visitor token for a public persona",
        "description": "Unauthenticated, and the only way to obtain a visitor token. The token is returned once and never again — nothing server-side can reproduce it.\n\nSlugs are unique per owner, not globally, so a slug shared by two *public* personas is a 409 rather than an arbitrary pick. A persona that is not public, does not exist, or whose owner cannot be resolved is uniformly a 404.\n\nRefused with 403 when the owning ecosystem has not enabled visitor chat, 503 when visitor chat is switched off globally, and 429 past the per-IP hourly mint limit.",
        "responses": {
          "201": {
            "description": "A visitor token, shown once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitorToken"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/visitor-chat/conversations": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "Start a visitor conversation",
        "description": "Requires a visitor token (`tmp_…`) in the Authorization header — any other kind of token is a 403. The persona is taken from the token. Conversations expire on their own after a fixed window.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitorConversationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new conversation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitorConversation"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/visitor-chat/conversations/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Read a visitor conversation and its messages",
        "description": "Scoped to the token that created it: another visitor's conversation, or an expired one, is a 404 — the same answer as one that never existed.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The conversation with its messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitorConversationDetail"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/visitor-chat/conversations/{id}/turns": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "public"
        ],
        "summary": "Take a turn in a visitor conversation (SSE)",
        "description": "Streams the persona's reply as Server-Sent Events (`text/event-stream`): an `open` event, then `token`, `tool_call_started`, `tool_call_completed`, `status` and `award` events, ending in `done`, `ended` (the persona closed the chat) or `error`.\n\nEvery check happens BEFORE the stream opens, so a refusal is always a real HTTP status: 409 when the conversation is closed or full, 422 when the message is too long or is screened out, 429 past a rate window, 503 when capacity or budget is exhausted. Once the stream is open, HTTP is already 200 and any later failure arrives as an `error` event instead.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitorTurnRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSE stream of the reply",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/VisitorTurnEvent"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/identifiers": {
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Search rdids by prefix, or resolve a batch of entity ids (admin only)",
        "description": "Send `q` for a left-anchored prefix search, or `entityIds` for a batch reverse lookup — never both. Only canonical rows are returned; aliases are never offered. Unknown ids in a batch are omitted rather than failing the request.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "the matching mappings, rdid-ascending",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RegistryIdentifier"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Create an rdid -> entity mapping",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rdid",
                  "entityType",
                  "entityId"
                ],
                "properties": {
                  "rdid": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "entityType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32
                  },
                  "entityId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "mapping",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryIdentifier"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/identifiers/{rdid}": {
      "parameters": [
        {
          "name": "rdid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Resolve an rdid -> entity",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "mapping",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryIdentifier"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "registry"
        ],
        "summary": "Rename an rdid (entity/uuid unchanged)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rdid"
                ],
                "properties": {
                  "rdid": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "mapping",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryIdentifier"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registry"
        ],
        "summary": "Delete an rdid mapping (creator-only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/identifiers/{rdid}/exists": {
      "parameters": [
        {
          "name": "rdid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Check whether an rdid is taken (never 404)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "existence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "exists"
                  ],
                  "properties": {
                    "exists": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/personas/approvals": {
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List the persona-action approvals the caller may decide",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "the decidable approvals (newest first)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "approvals"
                  ],
                  "properties": {
                    "approvals": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryPersonaApproval"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/personas/approvals/{id}/approve": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Approve a parked action — runs it in the original acting context",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "the decided approval (with the captured result)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "approval"
                  ],
                  "properties": {
                    "approval": {
                      "$ref": "#/components/schemas/RegistryPersonaApproval"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/processing/personas/approvals/{id}/reject": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Reject a parked action — no execution",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "the rejected approval",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "approval"
                  ],
                  "properties": {
                    "approval": {
                      "$ref": "#/components/schemas/RegistryPersonaApproval"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries": {
      "parameters": [
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE's owning principal (the caller's own customer slug, or an organization the caller belongs to). Omitted: the caller's own personal workspace. Unknown/foreign slug: 404."
        }
      ],
      "get": {
        "tags": [
          "registries"
        ],
        "summary": "List the caller's (or named workspace's) registries, non-deleted, by name",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Registries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Registry"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registries"
        ],
        "summary": "Create a registry",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "purpose": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "categoryRoot": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "entryTerm": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "maxItems": 32,
                    "description": "Discovery labels; trimmed and de-duplicated server-side."
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "hub",
                      "private"
                    ]
                  },
                  "submissionPolicy": {
                    "type": "string",
                    "enum": [
                      "open",
                      "reviewed"
                    ]
                  },
                  "servicesEnabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created registry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Registry"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registries"
        ],
        "summary": "Get a registry",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Registry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Registry"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "registries"
        ],
        "summary": "Update a registry",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "purpose": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "categoryRoot": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "entryTerm": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "maxItems": 32,
                    "description": "Discovery labels; trimmed and de-duplicated server-side."
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "hub",
                      "private"
                    ]
                  },
                  "submissionPolicy": {
                    "type": "string",
                    "enum": [
                      "open",
                      "reviewed"
                    ]
                  },
                  "servicesEnabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Registry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Registry"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registries"
        ],
        "summary": "Soft-delete a registry (frees its slug)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{id}/sections": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registries"
        ],
        "summary": "List a registry's sections (non-deleted, by sortOrder)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistrySection"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registries"
        ],
        "summary": "Add a section",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "label"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "sortOrder": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created section",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrySection"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{id}/sections/{sectionId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "sectionId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "registries"
        ],
        "summary": "Update a section",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "sortOrder": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Section",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrySection"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registries"
        ],
        "summary": "Soft-delete a section",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{id}/field-defs": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registries"
        ],
        "summary": "List a registry's field defs (non-deleted, by sortOrder)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Field defs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryFieldDef"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registries"
        ],
        "summary": "Add a field def to a section",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sectionId",
                  "key",
                  "type",
                  "label"
                ],
                "properties": {
                  "sectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "key": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "textarea",
                      "markdown",
                      "select",
                      "multi_select",
                      "url",
                      "email",
                      "phone",
                      "boolean",
                      "date",
                      "image",
                      "address"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "help": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "sortOrder": {
                    "type": "integer"
                  },
                  "config": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "authenticated",
                      "private"
                    ],
                    "description": "Omitted: derived from `type` by `defaultVisibilityForType` — a contact type (email, phone, address) starts 'private', everything else 'public'. The default is where the contact-privacy protection lives; publishing a phone number is a decision the owner makes, not one they inherit."
                  },
                  "showIf": {
                    "type": "object",
                    "nullable": true,
                    "required": [
                      "field",
                      "op",
                      "value"
                    ],
                    "properties": {
                      "field": {
                        "type": "string"
                      },
                      "op": {
                        "type": "string",
                        "enum": [
                          "eq",
                          "ne",
                          "truthy",
                          "falsy",
                          "in",
                          "contains"
                        ]
                      },
                      "value": {
                        "description": "JSON value, nested no deeper than 8 levels"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created field def",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryFieldDef"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{id}/field-defs/{fieldId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "fieldId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "registries"
        ],
        "summary": "Update a field def (key/type immutable — a type change is a 400, a key change a no-op)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "help": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "sortOrder": {
                    "type": "integer"
                  },
                  "config": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "authenticated",
                      "private"
                    ],
                    "description": "The owner's ceiling for this field across every entry"
                  },
                  "showIf": {
                    "type": "object",
                    "nullable": true,
                    "required": [
                      "field",
                      "op",
                      "value"
                    ],
                    "properties": {
                      "field": {
                        "type": "string"
                      },
                      "op": {
                        "type": "string",
                        "enum": [
                          "eq",
                          "ne",
                          "truthy",
                          "falsy",
                          "in",
                          "contains"
                        ]
                      },
                      "value": {
                        "description": "JSON value, nested no deeper than 8 levels"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Field def",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryFieldDef"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registries"
        ],
        "summary": "Soft-delete a field def (its values stay in entries.values, untouched)",
        "description": "Cascades to the rules that name it: every live field def in this registry whose `showIf.field` equals the deleted field's key has its `showIf` cleared, in the same transaction. A rule naming a field that no longer exists never fires, so without this the dependent fields would silently disappear from the form. Clients should NOT patch those rules themselves afterwards — the work is already done, and doing it per dependent reindexes the whole registry once per PATCH.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{registryId}/entries/mine": {
      "parameters": [
        {
          "name": "registryId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE's owning principal (the caller's own customer slug, or an organization the caller belongs to). Omitted: the caller's own personal workspace. Unknown/foreign slug: 404."
        }
      ],
      "get": {
        "tags": [
          "registries"
        ],
        "summary": "The caller's own entry in this registry, or 404 if they have none — a pure read that never creates one",
        "description": "The creating half is POST on this same path. Splitting them is what keeps a GET from writing: this route is reachable by anyone who can read the registry, so a get-or-create GET planted a draft entry for every signed-in passer-by, and those drafts are visible to the registry's owner through GET /entries. 404 here means \"you have no entry yet\", which is a normal state, not an error.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryEntry"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registries"
        ],
        "summary": "The caller's own entry in this registry, created as a draft if they have none. Idempotent — a concurrent first call returns the same row either way, never a 409",
        "description": "Takes no body: everything about the new row is derived from the caller and the registry (`draft` status, the registry's default visibility, an empty `values`). Returns 200 with the existing row when one is already there, so a client may call it unconditionally when opening the editor. Idempotency is enforced by `uq_entries_registry_owner`, not by the read that precedes the insert.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryEntry"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{registryId}/entries": {
      "parameters": [
        {
          "name": "registryId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE's owning principal (the caller's own customer slug, or an organization the caller belongs to). Omitted: the caller's own personal workspace. Unknown/foreign slug: 404."
        }
      ],
      "get": {
        "tags": [
          "registries"
        ],
        "summary": "Every entry in a registry, for whoever administers it — the review queue behind the `reviewed` submission policy. Approving is a PATCH of {status:\"published\"} on an entry by the registry owner; rejecting is the same PATCH with \"draft\"",
        "description": "Requires the `registries` sub-item R verb on this registry, because it returns other principals' unpublished entries: a registrant reads their own row through /entries/mine, and anonymous visitors see only published ones through the public routes. Newest first by createdAt — unlike the alphabetical registry list, since this list's job is \"what came in while I was away\". Soft-deleted entries are never returned.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "pending",
                "published"
              ]
            },
            "description": "Return only entries in this state. `pending` is the review queue. An unrecognised value is a 400, never an empty list."
          }
        ],
        "responses": {
          "200": {
            "description": "Entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryEntry"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registries"
        ],
        "summary": "Create the caller's entry in a registry (one entry per principal per registry)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$"
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "summary": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "photoAttachmentId": {
                    "type": "string",
                    "maxLength": 36,
                    "nullable": true
                  },
                  "providerType": {
                    "type": "string",
                    "enum": [
                      "person",
                      "organization",
                      "persona"
                    ]
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "keywords": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "maxItems": 32
                  },
                  "locationText": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "countryCode": {
                    "type": "string"
                  },
                  "regionCode": {
                    "type": "string",
                    "maxLength": 8
                  },
                  "geo": {
                    "type": "object",
                    "nullable": true,
                    "required": [
                      "lat",
                      "lon"
                    ],
                    "properties": {
                      "lat": {
                        "type": "number"
                      },
                      "lon": {
                        "type": "number"
                      }
                    }
                  },
                  "areaServed": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "deliveryMode": {
                    "type": "string",
                    "enum": [
                      "in_person",
                      "virtual",
                      "hybrid"
                    ]
                  },
                  "links": {
                    "type": "array",
                    "maxItems": 32,
                    "items": {
                      "type": "object",
                      "required": [
                        "label",
                        "url"
                      ],
                      "properties": {
                        "label": {
                          "type": "string",
                          "maxLength": 64
                        },
                        "url": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "contactMode": {
                    "type": "string",
                    "enum": [
                      "dm",
                      "none"
                    ]
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "maxItems": 32
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "pending",
                      "published"
                    ]
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "hub",
                      "private"
                    ]
                  },
                  "values": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "shape-checked against the live field defs on every write; required-ness only enforced when the resulting status is (or stays) published. On PATCH this is a JSON Merge Patch (RFC 7386) applied to the STORED values, not a full replace: a key you omit is left untouched; a key you send with a non-null value replaces that one field; a key you send as null DELETES it. Send only the section you are editing — the rest of the entry is preserved. On POST there is no prior state, so this object IS the initial values as given (null has no special meaning here)."
                  },
                  "valueVisibility": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "public",
                        "authenticated",
                        "private"
                      ],
                      "nullable": true
                    },
                    "description": "The registrant's per-field audience overrides on THIS entry, keyed by field_defs.key. Merge-patch like `values`: a key you omit keeps its stored setting, a key sent as null clears the override back to the def's setting. Each override may only TIGHTEN the owner's ceiling (RegistryFieldDef.visibility); asking for a WIDER one is a 400 naming the field, never a silent clamp — a 200 would leave the registrant believing they published a field the owner keeps private. A stored override the owner has since tightened past is clamped and written back without erroring, since it was already clamped on every read."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryEntry"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{registryId}/entries/{entryId}": {
      "parameters": [
        {
          "name": "registryId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "entryId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE's owning principal (the caller's own customer slug, or an organization the caller belongs to). Omitted: the caller's own personal workspace. Unknown/foreign slug: 404."
        }
      ],
      "patch": {
        "tags": [
          "registries"
        ],
        "summary": "Update an entry (owner or the registry owner). Publishing, or editing an already-published entry, is refused (400) while a required field is blank or hidden-by-rule",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$"
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "summary": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "photoAttachmentId": {
                    "type": "string",
                    "maxLength": 36,
                    "nullable": true
                  },
                  "providerType": {
                    "type": "string",
                    "enum": [
                      "person",
                      "organization",
                      "persona"
                    ]
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "keywords": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "maxItems": 32
                  },
                  "locationText": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "countryCode": {
                    "type": "string"
                  },
                  "regionCode": {
                    "type": "string",
                    "maxLength": 8
                  },
                  "geo": {
                    "type": "object",
                    "nullable": true,
                    "required": [
                      "lat",
                      "lon"
                    ],
                    "properties": {
                      "lat": {
                        "type": "number"
                      },
                      "lon": {
                        "type": "number"
                      }
                    }
                  },
                  "areaServed": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "deliveryMode": {
                    "type": "string",
                    "enum": [
                      "in_person",
                      "virtual",
                      "hybrid"
                    ]
                  },
                  "links": {
                    "type": "array",
                    "maxItems": 32,
                    "items": {
                      "type": "object",
                      "required": [
                        "label",
                        "url"
                      ],
                      "properties": {
                        "label": {
                          "type": "string",
                          "maxLength": 64
                        },
                        "url": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "contactMode": {
                    "type": "string",
                    "enum": [
                      "dm",
                      "none"
                    ]
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "maxItems": 32
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "pending",
                      "published"
                    ]
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "hub",
                      "private"
                    ]
                  },
                  "values": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "shape-checked against the live field defs on every write; required-ness only enforced when the resulting status is (or stays) published. On PATCH this is a JSON Merge Patch (RFC 7386) applied to the STORED values, not a full replace: a key you omit is left untouched; a key you send with a non-null value replaces that one field; a key you send as null DELETES it. Send only the section you are editing — the rest of the entry is preserved. On POST there is no prior state, so this object IS the initial values as given (null has no special meaning here)."
                  },
                  "valueVisibility": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "public",
                        "authenticated",
                        "private"
                      ],
                      "nullable": true
                    },
                    "description": "The registrant's per-field audience overrides on THIS entry, keyed by field_defs.key. Merge-patch like `values`: a key you omit keeps its stored setting, a key sent as null clears the override back to the def's setting. Each override may only TIGHTEN the owner's ceiling (RegistryFieldDef.visibility); asking for a WIDER one is a 400 naming the field, never a silent clamp — a 200 would leave the registrant believing they published a field the owner keeps private. A stored override the owner has since tightened past is clamped and written back without erroring, since it was already clamped on every read."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryEntry"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registries"
        ],
        "summary": "Soft-delete an entry (frees its slug and its one-per-registry owner slot)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{registryId}/entries/{entryId}/services": {
      "parameters": [
        {
          "name": "registryId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "entryId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE's owning principal (the caller's own customer slug, or an organization the caller belongs to). Omitted: the caller's own personal workspace. Unknown/foreign slug: 404."
        }
      ],
      "get": {
        "tags": [
          "registries"
        ],
        "summary": "List an entry's services (non-deleted, by sortOrder)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Services",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryEntryService"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registries"
        ],
        "summary": "Add a priced service to an entry",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "pricingModel": {
                    "type": "string",
                    "enum": [
                      "hourly",
                      "per_job",
                      "per_deliverable",
                      "subscription",
                      "free",
                      "barter"
                    ]
                  },
                  "priceMin": {
                    "type": "integer",
                    "minimum": 0,
                    "nullable": true
                  },
                  "priceMax": {
                    "type": "integer",
                    "minimum": 0,
                    "nullable": true
                  },
                  "currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  "unit": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "deliveryMode": {
                    "type": "string",
                    "enum": [
                      "in_person",
                      "virtual",
                      "hybrid"
                    ]
                  },
                  "sortOrder": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created service",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryEntryService"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/registries/{registryId}/entries/{entryId}/services/{serviceId}": {
      "parameters": [
        {
          "name": "registryId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "entryId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "serviceId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "workspace",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Scope to this WORKSPACE's owning principal (the caller's own customer slug, or an organization the caller belongs to). Omitted: the caller's own personal workspace. Unknown/foreign slug: 404."
        }
      ],
      "patch": {
        "tags": [
          "registries"
        ],
        "summary": "Update a service",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "pricingModel": {
                    "type": "string",
                    "enum": [
                      "hourly",
                      "per_job",
                      "per_deliverable",
                      "subscription",
                      "free",
                      "barter"
                    ]
                  },
                  "priceMin": {
                    "type": "integer",
                    "minimum": 0,
                    "nullable": true
                  },
                  "priceMax": {
                    "type": "integer",
                    "minimum": 0,
                    "nullable": true
                  },
                  "currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  "unit": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "deliveryMode": {
                    "type": "string",
                    "enum": [
                      "in_person",
                      "virtual",
                      "hybrid"
                    ]
                  },
                  "sortOrder": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Service",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryEntryService"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registries"
        ],
        "summary": "Soft-delete a service",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/registry/contact/{registrySlug}/{entrySlug}": {
      "parameters": [
        {
          "name": "registrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "entrySlug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "registries"
        ],
        "summary": "Open a DM with a public entry's owner and send the opening message",
        "description": "Resolves the entry server-side from its two slugs — the visitor never learns the owner id unless the owner answers. Only a published entry with contactMode \"dm\" on a public registry is contactable; an org- or persona-owned entry has no user to DM (409). Gated behind the per-ecosystem `messaging` opt-in (403 when off).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "body"
                ],
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "DM opened and the message sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryContactResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/organization/organizations": {
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List the organizations a workspace owns (personal workspaces also include the ones you belong to)",
        "description": "Scoped by `workspace`, which is REQUIRED — an unscoped organizations list is the same answer in every workspace, which is the bug this replaced. A PERSONAL workspace answers with the orgs you own UNION the orgs you belong to; an ORGANIZATION workspace answers with the orgs that org owns, never including itself. A workspace slug the caller neither owns nor reaches is a 404, the same answer as one that does not exist. Ordered by name (case-insensitively, ties broken by id) and capped at 500 rows.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "organizations visible from that workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationListRow"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Create + provision an organization and its ownership chain",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Creates the organization owned by `workspace` (default: the caller personal workspace). Creating into an ORGANIZATION workspace requires admin of that org or of one above it in its ownership chain (or the site-admin grant) — 403 otherwise: the new org lands on that workspace's rail and is governed through its chain.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "provisioned organization (org + namespace + admin team + ecosystem)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryProvisionedOrganization"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/organization/organizations/{key}": {
      "parameters": [
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Resolve an organization by UUID, slug, or rdid",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryOrganization"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/organization/organizations/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "registry"
        ],
        "summary": "Update an organization (name/description: org-team admin or site-admin; slug: site-admin only — re-mints the global rdids)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one of name, slug, or description is required.",
                "minProperties": 1,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryOrganization"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registry"
        ],
        "summary": "Archive an organization — hides it and releases its rdid (org creator, org-team admin, or site-admin)",
        "description": "Archives the organization, its workspace and everything addressed under its slug. 404 when it does not exist or is already archived. 409 with a `code` when it may not be archived: `operators_org` for the operators organization, the root every workspace hangs under; `org_has_child_orgs` while it owns a live organization, which must be archived or deleted first. Nothing is archived on a 409.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "archived"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/organization/organizations/{id}/restore": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Restore an archived organization to its own rdid (org creator, org-team admin, or site-admin)",
        "description": "Restores the organization under its own slug, and its workspace under the owner's workspace as it is now; an address that moves with it keeps its old form as an alias. A 409 leaves the organization archived: its handle was taken while it was archived, by an organization or as a user slug; `code: owner_org_archived` while the organization that owns it is archived (restore that one first); `code: owner_has_no_workspace` when its owner has no workspace to restore its own into; or the restored addresses would be inconsistent (`violations`).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "organization",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "organization"
                  ],
                  "properties": {
                    "organization": {
                      "$ref": "#/components/schemas/RegistryOrganization"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/namespaces": {
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Create a namespace + mint its rdid (site-admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ownerKind",
                  "ownerId",
                  "rdid"
                ],
                "properties": {
                  "ownerKind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "organization",
                      "persona",
                      "ecosystem"
                    ]
                  },
                  "ownerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "rdid": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "Reverse-domain prefix"
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "namespace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryNamespace"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/namespaces/{key}": {
      "parameters": [
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Resolve a namespace by UUID or rdid",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "namespace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryNamespace"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/namespaces/{id}/ecosystems": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Create an ecosystem under a namespace (site-admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "rdid": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "Override; defaults to <namespace-prefix>.<slug>"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "ecosystem",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryEcosystem"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/namespaces/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "registry"
        ],
        "summary": "Update a namespace handle/label (site-admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one of name or slug is required.",
                "minProperties": 1,
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "namespace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryNamespaceUpdate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registry"
        ],
        "summary": "Soft-delete a namespace + free its rdid (site-admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/auth-settings/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Ecosystem uuid or rdid"
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Read an ecosystem's sign-up/sign-in policy",
        "description": "An ecosystem that has never been configured returns the defaults, not a 404.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The policy in force",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemAuthSettings"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "registry"
        ],
        "summary": "Update an ecosystem's sign-up/sign-in policy",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcosystemAuthSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The policy after the update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemAuthSettings"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/client-auth/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Ecosystem uuid or rdid"
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Read an ecosystem's client auth",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The client auth in force",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemClientAuth"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "registry"
        ],
        "summary": "Update an ecosystem's client auth",
        "description": "Every 400 is checked before anything is written. The registration Hydra client is written last; if Hydra fails the call is a 500 and nothing is written.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcosystemClientAuthUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The client auth after the update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemClientAuth"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/applications/{appId}/client-auth": {
      "parameters": [
        {
          "name": "appId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The application uuid or rdid"
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Read an application's client auth",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The application's platform and registration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationClientAuth"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "registry"
        ],
        "summary": "Update an application's client auth",
        "description": "Requires managing the application's ecosystem. Every 400 is checked before anything is written; the registration Hydra client is written last.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationClientAuthUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The client auth after the update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationClientAuth"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/signin-apps/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Ecosystem uuid or rdid"
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List an ecosystem's sign-in apps",
        "description": "Internal clients are excluded — they are not manageable through this surface.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sign-in apps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EcosystemSigninApp"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Create a sign-in app for an ecosystem",
        "description": "The client is bound to this ecosystem by the server; the body cannot name a different one. Asking for GitHub sign-in when no GitHub provider is configured is a 400, checked before anything is written. The app is also registered as a Hydra public PKCE client; if that fails the call is a 500 and nothing is written.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcosystemSigninAppCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created app",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemSigninApp"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/signin-apps/{id}/{clientId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Ecosystem uuid or rdid"
        },
        {
          "name": "clientId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The client uuid"
        }
      ],
      "patch": {
        "tags": [
          "registry"
        ],
        "summary": "Update a sign-in app",
        "description": "A client belonging to another ecosystem is a 404, not a 403 — the two are indistinguishable from outside. An internal client exists but is a 403.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcosystemSigninAppUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The app after the update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcosystemSigninApp"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registry"
        ],
        "summary": "Delete a sign-in app",
        "description": "Also removes the client’s provider links and its Hydra client (Hydra first, so a Hydra failure leaves the app in place to retry). Internal clients cannot be deleted (403).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/bootstrap": {
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Everything a persona implementation needs to start, from its token alone",
        "description": "Requires a persona or visitor API token (`tmp_…`) in the Authorization header — NOT a user session JWT, which is a 400, and not an application token, which is a 403. The token identifies the persona; there is nothing to pass.\n\nA visitor token gets the same shape with the anonymous floor applied: no tools, no memory, read-only buckets, and the public conversation URL. If the persona has since been made non-public, a visitor token stops working (403) even though it has not expired.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The persona, its prompt, and what its token may do",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaBootstrap"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/demo-preview": {
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Play one turn of an unsaved demo-chat ink script",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source"
                ],
                "properties": {
                  "source": {
                    "type": "string",
                    "maxLength": 65536,
                    "description": "The draft ink source, exactly as it sits in the editor"
                  },
                  "signInLine": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "What the persona says to an anonymous visitor it cannot answer. Blank ⇒ the platform default."
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 4000,
                    "description": "The visitor's message this turn. Omit it with an empty `history` to lint the script and see the opening block — the story plays its opening without consulting the message."
                  },
                  "history": {
                    "type": "array",
                    "maxItems": 40,
                    "description": "The transcript BEFORE this message. The story is replayed over it.",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "type": "string",
                          "maxLength": 4000
                        }
                      }
                    }
                  },
                  "canEscalate": {
                    "type": "boolean",
                    "default": false,
                    "description": "Preview the SIGNED-IN visitor's demo, where an off-script message falls through to the real model (`text: null`). Default previews the anonymous one."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "what the persona says this turn, and what the story would accept next",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "text",
                    "onScript",
                    "signInLine",
                    "budgetExhausted",
                    "choices",
                    "diagnostics",
                    "tagPlacementHint"
                  ],
                  "properties": {
                    "text": {
                      "type": "string",
                      "nullable": true,
                      "description": "Null ⇒ the turn ESCALATES: the real model answers and the demo says nothing"
                    },
                    "onScript": {
                      "type": "boolean",
                      "description": "False ⇒ the message matched no standing choice"
                    },
                    "signInLine": {
                      "type": "boolean",
                      "description": "The reply is the sign-in line, not the script"
                    },
                    "budgetExhausted": {
                      "type": "boolean",
                      "description": "The story does not terminate"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PersonaDemoPreviewChoice"
                      }
                    },
                    "diagnostics": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PersonaDemoPreviewDiagnostic"
                      }
                    },
                    "tagPlacementHint": {
                      "type": "string",
                      "description": "The one sentence about where `# match:` and `# off_script` go"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/personas/{id}/tokens": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List a persona's API tokens (metadata only; raw values never returned)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "the persona's outstanding tokens (metadata only, newest first)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tokens"
                  ],
                  "properties": {
                    "tokens": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryPersonaToken"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Mint a scoped API token that lets the persona act (raw value shown once)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "subject"
                ],
                "properties": {
                  "subject": {
                    "type": "object",
                    "required": [
                      "kind"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "self",
                          "user",
                          "team",
                          "org"
                        ],
                        "description": "`self` (owner-gated) or `user` (the caller lets the persona act AS themselves, gated on the persona’s `may_act user` opt-in) or `team` (owner-gated; the persona acts AS the team `id` in the target `ecosystemId`, gated on `may_act team` + persona team-membership + the team’s reach into that ecosystem) or `org` (owner-gated; the persona acts AS the organization `id` it is OWNED BY, gated on `may_act org` + org-ownership; the acting ecosystem is the org’s own, derived server-side)."
                      },
                      "id": {
                        "type": "string",
                        "description": "The team id for a `team` subject (required for `team`) or the org id for an `org` subject (required for `org`). Ignored for `self` (derived from the persona) and `user` (always the authenticated caller, never a param)."
                      },
                      "ecosystemId": {
                        "type": "string",
                        "description": "The TARGET ecosystem a `team` subject acts in (required for `team`); ignored for the other kinds (an `org` subject’s ecosystem is derived from the org, never taken from the request)."
                      }
                    }
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "nullable": true,
                    "description": "Omitted/null defaults to a bounded 90-day TTL (never a non-expiring token); an explicit value is honored."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "the minted token metadata + its raw value (shown once)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryPersonaTokenCreated"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/personas/{id}/tokens/{tokenId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "tokenId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "registry"
        ],
        "summary": "Revoke one of the persona's tokens — the explicit kill switch (scoped to this persona)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "revoked"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/mcp-servers": {
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List registered third-party MCP servers, secrets redacted (site-admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "the registered servers (newest first, secrets redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "servers"
                  ],
                  "properties": {
                    "servers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryAgentMcpServer"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Register a new third-party MCP server (site-admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "url"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9-]*$",
                    "description": "The globally-unique `<server>` handle in `mcp.<server>.<tool>`"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "The remote MCP server's http(s) endpoint URL"
                  },
                  "authSecret": {
                    "type": "string",
                    "description": "Optional per-server bearer secret; stored encrypted, never returned"
                  },
                  "enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Opt-in; defaults to disabled (contributes no tools until enabled)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "the registered server (secret redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "server"
                  ],
                  "properties": {
                    "server": {
                      "$ref": "#/components/schemas/RegistryAgentMcpServer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/mcp-servers/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "Get one third-party MCP server, secret redacted (site-admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "the server (secret redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "server"
                  ],
                  "properties": {
                    "server": {
                      "$ref": "#/components/schemas/RegistryAgentMcpServer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "registry"
        ],
        "summary": "Update / enable / disable / rotate the secret of an MCP server (site-admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "All fields optional. A blank or absent authSecret PRESERVES the stored secret; a present non-empty value rotates it.",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "authSecret": {
                    "type": "string",
                    "description": "Blank/absent preserves the stored secret; a non-empty value rotates it"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "the updated server (secret redacted)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "server"
                  ],
                  "properties": {
                    "server": {
                      "$ref": "#/components/schemas/RegistryAgentMcpServer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registry"
        ],
        "summary": "Soft-delete a third-party MCP server (site-admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "deleted (soft delete; the source stops surfacing its tools)"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/search/discussions": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Search discussions — topics by title, posts by body (via content.markdown)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "topics",
                "posts"
              ]
            },
            "description": "Restrict to one collection; omit to search both."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching topics and posts (ranked), with per-collection paging",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "topics",
                    "posts",
                    "page",
                    "pageSize",
                    "topicsHasMore",
                    "postsHasMore"
                  ],
                  "properties": {
                    "topics": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SearchDiscussionTopicResult"
                      }
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SearchDiscussionPostResult"
                      }
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    },
                    "topicsHasMore": {
                      "type": "boolean"
                    },
                    "postsHasMore": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/search/documents": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Full-text search the caller's document blocks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching document blocks (ranked) with a plain-text snippet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "results",
                    "limit",
                    "hasMore"
                  ],
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SearchDocumentResult"
                      }
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/search/notes": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Full-text search the caller's notes (markdown body)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching notes, most-recently-updated first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "results",
                    "limit"
                  ],
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SearchNoteResult"
                      }
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/repos": {
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "The whole tree: every folder and repository the caller reaches",
        "description": "One request, because the tree is one component. A repository the caller has no grant on is ABSENT, not greyed out; a folder with nothing reachable in it is absent too, unless the caller holds workspace-level R.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The workspace slug to act in. Omitted, the caller's own personal workspace."
          }
        ],
        "responses": {
          "200": {
            "description": "The tree",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "groups",
                    "items"
                  ],
                  "properties": {
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string"
                        },
                        "ownerId": {
                          "type": "string"
                        }
                      }
                    },
                    "verbs": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "C",
                          "R",
                          "U",
                          "D",
                          "M"
                        ]
                      },
                      "description": "What the caller may do at workspace level. A hint for what to DRAW — every route re-derives its own verb."
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShiprGroup"
                      }
                    },
                    "personas": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShiprPersona"
                      },
                      "description": "Every persona this workspace owns — the vocabulary for `items[].personaIds`, carried once here rather than repeated on every row."
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/ShiprRepo"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "devRepo": {
                                "anyOf": [
                                  {
                                    "$ref": "#/components/schemas/ShiprDevRepo"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "state": {
                                "type": "object",
                                "nullable": true
                              },
                              "personaIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "This repository's crew, as ids into `personas`. Who is expected to work on the pipeline — NOT who may run it, which is the `shipr` grant on the persona's role."
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/repos/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "A deploy repository (mirror) id."
        }
      ],
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "One repository, with its ladder and recent runs",
        "description": "The ladder is READ from the last status run, not computed — `readAt` says when it was true, and the status button is the refresh.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The repository",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "repo": {
                      "$ref": "#/components/schemas/ShiprRepo"
                    },
                    "devRepo": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ShiprDevRepo"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "group": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ShiprGroup"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ladder": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ShiprLadder"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "runs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShiprRun"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "shipr"
        ],
        "summary": "Move it, reorder it, rename it, or change which branches it ships to",
        "description": "TWO TABLES, ONE ROUTE: `displayName` is the DEV repo’s label, addressed through a mirror the way `/platforms` is, because a mirror is the only thing this console has an id for. `shard` is never editable. `slug` is editable ONLY while `registeredAt` is null — a repository that is still a plan may be pointed anywhere, and one that has been provisioned answers 409, because re-pointing it would strand its mirror, ladder and history on a repository nothing now names.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "groupId": {
                    "type": "string",
                    "nullable": true
                  },
                  "position": {
                    "type": "integer"
                  },
                  "slug": {
                    "type": "string",
                    "description": "owner/name of the DEPLOYMENT repository. 409 once it is provisioned."
                  },
                  "displayName": {
                    "type": "string",
                    "nullable": true,
                    "description": "The source repository’s label, shown in the console instead of its slug. Null clears it."
                  },
                  "shipBranch": {
                    "type": "string"
                  },
                  "envBranches": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated repository",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiprRepo"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/repos/{id}/personas": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "A deploy repository (mirror) id."
        }
      ],
      "put": {
        "tags": [
          "shipr"
        ],
        "summary": "Set which personas are on this repository's crew",
        "description": "The WHOLE set, not a delta, so that two operators saving different crews end at one of the two rather than at the union. GRANTS NOTHING: a crew says who is expected to work on this pipeline; whether a persona may actually run `deploy` is the `shipr` feature grant on its role, which migration 0206 deliberately withholds. An id naming a persona outside this repository's workspace is a 404 rather than a silent drop.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "personaIds"
                ],
                "properties": {
                  "personaIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 64
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The crew as stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "repoId",
                    "personaIds"
                  ],
                  "properties": {
                    "repoId": {
                      "type": "string"
                    },
                    "personaIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/repos/{id}/platforms": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "A deploy repository (mirror) id."
        }
      ],
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "Which platform credentials watch this repository",
        "description": "Addressed through a mirror, stored against its dev repo: every mirror of a repository shares one credential per platform, because the platform watches the deployment repository they all push to. `label` is null when the connection behind a row has been deleted — that pipeline falls back to 'the push is the deployment' on its next deploy.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The attached platform credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "platforms"
                  ],
                  "properties": {
                    "platforms": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "kind",
                          "connectionId",
                          "label"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "vercel"
                            ]
                          },
                          "connectionId": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/repos/{id}/platforms/{kind}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "A deploy repository (mirror) id."
        },
        {
          "name": "kind",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The platform. Only `vercel` today: Railway builds from the push it watches and exposes nothing a token could ask, so a row for it would be data nothing reads and this route refuses to write one."
        }
      ],
      "put": {
        "tags": [
          "shipr"
        ],
        "summary": "Attach a stored platform credential to this repository",
        "description": "WITHOUT THIS THE DEPLOY PIPELINE CANNOT CHECK ARRIVALS. The Vercel adapter is built from this row and from nowhere else; with no row the platform resolves to 'the push is the deployment', and a deploy whose build never ran passes. The connection must be the CALLER's own and its provider must equal `kind` — a credential for another provider would be handed to this platform's API on the next deploy. Idempotent: re-attaching replaces the id in place.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "connectionId"
                ],
                "properties": {
                  "connectionId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The credential was re-pointed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "kind",
                    "connectionId"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string"
                    },
                    "connectionId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "The credential was attached",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "kind",
                    "connectionId"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string"
                    },
                    "connectionId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "shipr"
        ],
        "summary": "Detach the platform credential",
        "description": "204 whether or not a row was there — a repository with no such credential has already reached the state the caller asked for. Soft, like everything else in this schema, so a run log that mentions the platform stays legible.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Detached"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/repos/{id}/status": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "A deploy repository (mirror) id."
        }
      ],
      "post": {
        "tags": [
          "shipr"
        ],
        "summary": "Queue a status for this repository",
        "description": "Sugar over POST /shipr/runs with scopeKind=deploy_repo. Returns immediately with a run id — watch it on /shipr/stream/runs/{id}.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "environments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "testing",
                        "staging",
                        "production"
                      ]
                    },
                    "description": "Which environments a deploy walks, in pipeline order. Ignored by every other operation; required (non-empty) by deploy."
                  },
                  "options": {
                    "type": "object",
                    "description": "Per-operation arguments. Read defensively; unknown keys are ignored.",
                    "properties": {
                      "sha": {
                        "type": "string",
                        "description": "prepare: the tip to pin. Absent means the dev repo’s main as it stands."
                      },
                      "shard": {
                        "type": "string",
                        "description": "register: which [deployments] key this mirror is."
                      },
                      "groupId": {
                        "type": "string",
                        "description": "register: the folder a FIRST registration files its new mirrors under."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The run was queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId"
                  ],
                  "properties": {
                    "runId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/repos/{id}/prepare": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "A deploy repository (mirror) id."
        }
      ],
      "post": {
        "tags": [
          "shipr"
        ],
        "summary": "Queue a prepare for this repository",
        "description": "Sugar over POST /shipr/runs with scopeKind=deploy_repo. Returns immediately with a run id — watch it on /shipr/stream/runs/{id}.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "environments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "testing",
                        "staging",
                        "production"
                      ]
                    },
                    "description": "Which environments a deploy walks, in pipeline order. Ignored by every other operation; required (non-empty) by deploy."
                  },
                  "options": {
                    "type": "object",
                    "description": "Per-operation arguments. Read defensively; unknown keys are ignored.",
                    "properties": {
                      "sha": {
                        "type": "string",
                        "description": "prepare: the tip to pin. Absent means the dev repo’s main as it stands."
                      },
                      "shard": {
                        "type": "string",
                        "description": "register: which [deployments] key this mirror is."
                      },
                      "groupId": {
                        "type": "string",
                        "description": "register: the folder a FIRST registration files its new mirrors under."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The run was queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId"
                  ],
                  "properties": {
                    "runId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/repos/{id}/deploy": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "A deploy repository (mirror) id."
        }
      ],
      "post": {
        "tags": [
          "shipr"
        ],
        "summary": "Queue a deploy for this repository",
        "description": "Sugar over POST /shipr/runs with scopeKind=deploy_repo. Returns immediately with a run id — watch it on /shipr/stream/runs/{id}.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "environments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "testing",
                        "staging",
                        "production"
                      ]
                    },
                    "description": "Which environments a deploy walks, in pipeline order. Ignored by every other operation; required (non-empty) by deploy."
                  },
                  "options": {
                    "type": "object",
                    "description": "Per-operation arguments. Read defensively; unknown keys are ignored.",
                    "properties": {
                      "sha": {
                        "type": "string",
                        "description": "prepare: the tip to pin. Absent means the dev repo’s main as it stands."
                      },
                      "shard": {
                        "type": "string",
                        "description": "register: which [deployments] key this mirror is."
                      },
                      "groupId": {
                        "type": "string",
                        "description": "register: the folder a FIRST registration files its new mirrors under."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The run was queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId"
                  ],
                  "properties": {
                    "runId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/repos/{id}/unregister": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "A deploy repository (mirror) id."
        }
      ],
      "post": {
        "tags": [
          "shipr"
        ],
        "summary": "Queue a unregister for this repository",
        "description": "Sugar over POST /shipr/runs with scopeKind=deploy_repo. Returns immediately with a run id — watch it on /shipr/stream/runs/{id}.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "environments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "testing",
                        "staging",
                        "production"
                      ]
                    },
                    "description": "Which environments a deploy walks, in pipeline order. Ignored by every other operation; required (non-empty) by deploy."
                  },
                  "options": {
                    "type": "object",
                    "description": "Per-operation arguments. Read defensively; unknown keys are ignored.",
                    "properties": {
                      "sha": {
                        "type": "string",
                        "description": "prepare: the tip to pin. Absent means the dev repo’s main as it stands."
                      },
                      "shard": {
                        "type": "string",
                        "description": "register: which [deployments] key this mirror is."
                      },
                      "groupId": {
                        "type": "string",
                        "description": "register: the folder a FIRST registration files its new mirrors under."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The run was queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId"
                  ],
                  "properties": {
                    "runId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/runs": {
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "The runs the caller may watch, newest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The workspace slug to act in. Omitted, the caller's own personal workspace."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Runs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShiprRun"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "shipr"
        ],
        "summary": "Queue any operation over any scope — the toolbar, as one route",
        "description": "A group scope walks the folder and everything nested under it, depth-first in tree order, one repository at a time. The caller must hold the operation’s verb over EVERY repository the scope expands to.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The workspace slug to act in. Omitted, the caller's own personal workspace."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "operation",
                  "scopeKind"
                ],
                "properties": {
                  "operation": {
                    "type": "string",
                    "enum": [
                      "status",
                      "prepare",
                      "deploy",
                      "register",
                      "unregister"
                    ]
                  },
                  "scopeKind": {
                    "type": "string",
                    "enum": [
                      "deploy_repo",
                      "dev_repo",
                      "group",
                      "all"
                    ]
                  },
                  "scopeId": {
                    "type": "string",
                    "nullable": true,
                    "description": "The mirror, dev repo or folder id. Null (or absent) for scopeKind=all."
                  },
                  "environments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "testing",
                        "staging",
                        "production"
                      ]
                    },
                    "description": "Which environments a deploy walks, in pipeline order. Ignored by every other operation; required (non-empty) by deploy."
                  },
                  "options": {
                    "type": "object",
                    "description": "Per-operation arguments. Read defensively; unknown keys are ignored.",
                    "properties": {
                      "sha": {
                        "type": "string",
                        "description": "prepare: the tip to pin. Absent means the dev repo’s main as it stands."
                      },
                      "shard": {
                        "type": "string",
                        "description": "register: which [deployments] key this mirror is."
                      },
                      "groupId": {
                        "type": "string",
                        "description": "register: the folder a FIRST registration files its new mirrors under."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The run was queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId"
                  ],
                  "properties": {
                    "runId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/runs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "One run, with its steps",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The run",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "run": {
                      "$ref": "#/components/schemas/ShiprRun"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShiprRunStep"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/runs/{id}/cancel": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "shipr"
        ],
        "summary": "Stop a queued or running run",
        "description": "Retires the run’s lease, so whatever is holding it stops within a heartbeat and can no longer write to the row. A STOP, not an undo: what the run already carried stays carried. Idempotent — a run that has already settled is returned unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The run, as it now stands",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "run"
                  ],
                  "properties": {
                    "run": {
                      "$ref": "#/components/schemas/ShiprRun"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/runs/{id}/events": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "A page of the run’s log",
        "description": "The same `seq` cursor the stream uses, so a client can start here and switch to the stream — or poll this where EventSource is unavailable — with one notion of position.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A deploy repository (mirror) id. Returns only the lines belonging to that repository's steps; omitted, the whole run."
          }
        ],
        "responses": {
          "200": {
            "description": "Log lines",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "events",
                    "nextSeq"
                  ],
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShiprRunEvent"
                      }
                    },
                    "nextSeq": {
                      "type": "integer"
                    },
                    "state": {
                      "type": "string"
                    },
                    "done": {
                      "type": "boolean",
                      "description": "The run has settled and there will never be more lines."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/connections": {
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "The caller’s own forge connections, for the register form",
        "description": "GitHub App installations belonging to the caller, active and not deleted — the only credential kind that can fast-forward a branch. Deliberately not `/integrations`’ list: that one is keyed on the ecosystem and carries every provider, so on an org workspace it offers rows `register` answers 404 to.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The connections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connections"
                  ],
                  "properties": {
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "label",
                          "accountLogin"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "accountLogin": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The GitHub account the app is installed on. This is the register form’s ORG CHOOSER: creating a repository under an org needs the app installed there, so an org with no connection is an org the run would fail in."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/connections/{id}/repositories": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "Every repository one connection can reach",
        "description": "What the installation was granted, which is exactly the set `register` can act on — offering anything wider means an operator picks a repository whose first push fails minutes later. The account-and-repository picker that produced this set is GitHub’s own installation page, so there is no org listing beside it. A connection that is not the caller’s own is a 404, never a 403: a 403 would confirm it exists.\n\nThis reads what was last stored, so it is a database read and normally cannot fail on GitHub’s account. The one exception is a connection nothing has been stored for yet: answering `[]` there would report an empty grant on the single occasion it is certainly untrue, so a miss goes and asks — which is why 502 is still among the responses. Use the refresh below to ask deliberately.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The repositories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "repositories",
                    "readAt"
                  ],
                  "properties": {
                    "repositories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "slug",
                          "defaultBranch",
                          "private"
                        ],
                        "properties": {
                          "slug": {
                            "type": "string",
                            "description": "owner/name"
                          },
                          "defaultBranch": {
                            "type": "string"
                          },
                          "private": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "readAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "When GitHub last said this. The picker shows a stored list immediately and refreshes behind it, so the list on screen can be older than the request that returned it — this is how a caller can say so instead of implying it is current."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/connections/{id}/repositories/refresh": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "shipr"
        ],
        "summary": "Ask GitHub again what this connection was granted",
        "description": "The Test button, and the read-then-refresh the picker does on open. Always goes to GitHub — a stored list never short-circuits it, because the whole reason to call this rather than the GET is to find out whether the credentials still work and what has changed since.\n\nThe answer replaces the stored row wholesale rather than merging into it: a grant is a set, and a merge would keep a repository the installation has since lost, which is exactly the kind of entry an operator would pick and only discover was gone at the first push. A call that cannot reach GitHub is a 502 and leaves the stored row untouched — a list read an hour ago can still be picked from, and an empty one cannot.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The repositories, as GitHub just described them",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "repositories",
                    "readAt"
                  ],
                  "properties": {
                    "repositories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "slug",
                          "defaultBranch",
                          "private"
                        ],
                        "properties": {
                          "slug": {
                            "type": "string",
                            "description": "owner/name"
                          },
                          "defaultBranch": {
                            "type": "string"
                          },
                          "private": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "readAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "When GitHub last said this. The picker shows a stored list immediately and refreshes behind it, so the list on screen can be older than the request that returned it — this is how a caller can say so instead of implying it is current."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/connections/{id}/declaration": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "slug",
          "in": "query",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The dev repository, `owner/name`, read through this connection."
        },
        {
          "name": "branch",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Which ref to read `.shipr` on. Defaults to `main`."
        }
      ],
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "What a repository’s committed `.shipr` declares it deploys to",
        "description": "The register form’s second question, and usually the answer that there is no second question: a declared `[deployments]` shard already names its slug, so the form must not offer an org and a name beside it. `deployments: null` is the fallback branch — no file, an unparseable one, or one declaring no shards — and is the only case in which `deploymentOwner`/`deploymentName` on `POST /shipr/register` are read. `note` carries the parser’s complaint when there was one. A forge that cannot be reached is a 502, never a null: a repository that could not be read is not a repository that declares nothing.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The declaration, or the fallback",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deployments",
                    "fallbackSlug"
                  ],
                  "properties": {
                    "deployments": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "required": [
                          "shard",
                          "slug"
                        ],
                        "properties": {
                          "shard": {
                            "type": "string",
                            "description": "The key in `[deployments]`."
                          },
                          "slug": {
                            "type": "string",
                            "description": "owner/name of that shard’s mirror."
                          }
                        }
                      }
                    },
                    "fallbackSlug": {
                      "type": "string",
                      "description": "The `<name>-deployment` convention applied to this repository — what a run creates when nothing is declared, and what the form prepopulates its org and name fields from."
                    },
                    "note": {
                      "type": "string",
                      "description": "Why the declaration was not usable, when it was present but not."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/register": {
      "post": {
        "tags": [
          "shipr"
        ],
        "summary": "Register a source repository and queue its provisioning",
        "description": "Find-or-create on the dev repo, then a register run. Re-registering is the ordinary path — it is how branch protection someone turned off gets repaired. What the repository deploys (how many mirrors, under what names) is read from its own `.shipr` by the run, not supplied here.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The workspace slug to act in. Omitted, the caller's own personal workspace."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "description": "owner/name on the forge."
                  },
                  "connectionId": {
                    "type": "string",
                    "description": "A GitHub App installation belonging to the caller, from `GET /shipr/connections`. Omitted, the repository is read anonymously — status works, nothing that writes does."
                  },
                  "groupId": {
                    "type": "string",
                    "description": "Where a FIRST registration files the mirrors it invents."
                  },
                  "mainBranch": {
                    "type": "string"
                  },
                  "preparedBranch": {
                    "type": "string"
                  },
                  "deploymentOwner": {
                    "type": "string",
                    "description": "Where the ONE mirror goes when `.shipr` declares no shards. Read only on that fallback — a declared shard’s slug is never overridden, because the file and the form must not be able to say two different things."
                  },
                  "deploymentName": {
                    "type": "string",
                    "description": "The mirror’s name on the same fallback. Defaults to `<name>-deployment`; overridable independently of the owner, because changing the org almost always keeps the name."
                  },
                  "provision": {
                    "type": "boolean",
                    "description": "Whether to GO AND MAKE IT, or only write down where it goes. `false` writes the rows synchronously, leaves `registeredAt` null and queues no run, so nothing is created on the forge under a name nobody has looked at yet; the operator then sets the org, the name and the environments and presses Provision, which is `POST /shipr/runs` with the same `register` operation. Defaults to true."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Configured — rows written, nothing provisioned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "devRepo",
                    "mirrors"
                  ],
                  "properties": {
                    "devRepo": {
                      "$ref": "#/components/schemas/ShiprDevRepo"
                    },
                    "mirrors": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShiprRepo"
                      }
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "What the run would have journalled: a repository carrying no `.shipr`, a malformed one, a slug another repository already spoke for. Present only when there is something to say."
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId"
                  ],
                  "properties": {
                    "runId": {
                      "type": "string"
                    },
                    "devRepo": {
                      "$ref": "#/components/schemas/ShiprDevRepo"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/org-defaults": {
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "The per-org defaults, all of them",
        "description": "A LIST AND NOT A LOOKUP: the menu that opens the Settings dialog already shows every org the caller’s installations reach, so one request fills every gear icon and an org nobody has configured is simply absent rather than a 404 the client has to read as “unset”.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The workspace slug to act in. Omitted, the caller's own personal workspace."
          }
        ],
        "responses": {
          "200": {
            "description": "The configured orgs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "orgDefaults"
                  ],
                  "properties": {
                    "orgDefaults": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShiprOrgDefaults"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/org-defaults/{org}": {
      "parameters": [
        {
          "name": "org",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "A forge account login."
        }
      ],
      "put": {
        "tags": [
          "shipr"
        ],
        "summary": "Set one org’s defaults",
        "description": "UPSERT, because “the defaults for this org” is one row whether or not anybody has written it yet. IT PROVISIONS NOTHING AND CHANGES NO EXISTING MIRROR — a default is read when a mirror is born, so writing one re-aims the next repository and leaves every registered one where the operator put it. An ABSENT field is left alone rather than reset, so a request about environments cannot quietly restore the suffix.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The workspace slug to act in. Omitted, the caller's own personal workspace."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deploymentOwner": {
                    "type": "string",
                    "nullable": true
                  },
                  "nameSuffix": {
                    "type": "string"
                  },
                  "envBranches": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The defaults as stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiprOrgDefaults"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/stream/runs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "A run’s log as server-sent events",
        "description": "Events: `line` (one log line, `id:` is its seq), `state` (the run changed state), `end` (settled — the stream closes). Resume with `Last-Event-ID` or `?after=<seq>`. Because EventSource cannot set headers, the bearer token may be passed as `?access_token=`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A deploy repository (mirror) id. Returns only the lines belonging to that repository's steps; omitted, the whole run."
          }
        ],
        "responses": {
          "200": {
            "description": "text/event-stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/stream": {
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "The workspace’s runs as they change state",
        "description": "A wake channel, not a log: `run` events carry a run’s identity and state so the tree can show what is moving. Open the per-run stream for output.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The workspace slug to act in. Omitted, the caller's own personal workspace."
          },
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "text/event-stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/feed": {
      "get": {
        "tags": [
          "personal"
        ],
        "summary": "List the caller's activity feed (filterable, paginated)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "entityType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "unread",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feed page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedPage"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/feed/unread-count": {
      "get": {
        "tags": [
          "personal"
        ],
        "summary": "Count the caller’s unread feed entries",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Unread count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedUnreadCount"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/feed/read-all": {
      "post": {
        "tags": [
          "personal"
        ],
        "summary": "Mark all of the caller’s feed entries as read",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Number marked read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedReadAllResult"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/feed/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "personal"
        ],
        "summary": "Get one of the caller’s feed entries",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Feed entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedItem"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "personal"
        ],
        "summary": "Delete one of the caller’s feed entries",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/feed/{id}/read": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "personal"
        ],
        "summary": "Mark one of the caller’s feed entries as read",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Marked read"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/feature-flags": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List feature flags (public; optional ?scope=system and ?key= exact-match filter)",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "By default the response unions the hub ecosystem's PRODUCT flags (hub rows are projected with id: 0) with the site-wide system.feature_flags rows. `scope=system` returns ONLY the system.feature_flags rows — the admin management view, which edits by serial id and must not receive the id-less hub-product rows.",
            "schema": {
              "type": "string",
              "enum": [
                "system"
              ]
            }
          },
          {
            "name": "key",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feature flags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FeatureFlag"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "system"
        ],
        "summary": "Create a feature flag (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created flag",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlag"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/feature-flags/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "system"
        ],
        "summary": "Update a feature flag (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated flag",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlag"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "system"
        ],
        "summary": "Delete a feature flag (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/server-bag": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List server-bag entries (public; optional ?key= exact-match filter)",
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Server bag entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ServerBag"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "system"
        ],
        "summary": "Create a server-bag entry (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "value"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "value": {
                    "description": "Arbitrary JSON value"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerBag"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/server-bag/{key}": {
      "parameters": [
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "system"
        ],
        "summary": "Update a server-bag entry (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "description": "Arbitrary JSON value"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerBag"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "system"
        ],
        "summary": "Delete a server-bag entry (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/access-audit": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Admin-only, cross-workspace access-audit trail (paginated, newest first)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audit page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessAuditPage"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/reserved-identifiers": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Admin-only list of held-but-unused rdids (paginated, newest-stuck first)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reserved identifier page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservedIdentifierPage"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/reserved-identifiers/release": {
      "post": {
        "tags": [
          "system"
        ],
        "summary": "Release one held rdid back into the pool (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rdid",
                  "entityType",
                  "entityId"
                ],
                "properties": {
                  "rdid": {
                    "type": "string",
                    "description": "The held identifier, exactly as listed"
                  },
                  "entityType": {
                    "type": "string",
                    "description": "Verified against the stored mapping"
                  },
                  "entityId": {
                    "type": "string",
                    "description": "Verified against the stored mapping"
                  },
                  "newNames": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "The name to give each dead row that is still sitting on its own slug, keyed by the held rdid — an entry per listed row whose `needsName` is true, including held descendants, since releasing a namespace releases the names inside it. A missing entry answers 409 naming the rdid it wants. A value that is not a legal segment, or that ends in what looks like a slice of an id, answers 400: an rdid is a name a person reads."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the release did",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/debug-env": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Env vars the backend reads (local-only, masked; 404 on deployed envs)",
        "responses": {
          "200": {
            "description": "Masked env entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "entries"
                  ],
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "value",
                          "secret"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string",
                            "description": "Masked when secret"
                          },
                          "secret": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/admin-notes": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Read a subject's admin notes, oldest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "subjectTable",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subjectId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Admin notes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AdminNote"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "system"
        ],
        "summary": "Reconcile a subject's admin notes",
        "description": "Replaces the whole set for the subject rather than editing one note: a note with an `id` is updated, one without is created, and any existing note the body omits is DELETED. Sending an empty `notes` array clears them all. Appends one `notes_updated` entry to the subject's history.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminNotesReconcileBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/entity-history": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Read a subject's history, newest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "subjectTable",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subjectId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "History entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EntityHistoryEntry"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/team/members": {
      "get": {
        "tags": [
          "team"
        ],
        "summary": "List a team's members (email-resolved)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "teamId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMemberList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "team"
        ],
        "summary": "Add a member to a team by email",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "teamId",
                  "email"
                ],
                "properties": {
                  "teamId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 255
                  },
                  "role": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMember"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/team/members/personas": {
      "post": {
        "tags": [
          "team"
        ],
        "summary": "Add a persona to a team (requires the persona may act via teams)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "teamId",
                  "personaKey"
                ],
                "properties": {
                  "teamId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "personaKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "the persona addressed by its registry key: uuid, persona rdid, or owned-namespace rdid"
                  },
                  "role": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added persona member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMember"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/team/members/counts": {
      "get": {
        "tags": [
          "team"
        ],
        "summary": "Member count per team in scope (the All-teams landing)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMemberCounts"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/team/members/{id}": {
      "delete": {
        "tags": [
          "team"
        ],
        "summary": "Remove a member from a team",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/features": {
      "get": {
        "tags": [
          "access"
        ],
        "summary": "List the feature areas this deployment enforces (key + display label)",
        "description": "The server-side registry (src/lib/feature-areas.ts) grants are recorded against. The shared roles editor renders one row per entry rather than a hardcoded list, so an area can be granted AND withheld on a custom role. Members only; non-members get 404.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feature areas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessFeatureList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/roles": {
      "get": {
        "tags": [
          "access"
        ],
        "summary": "List a workspace's roles with their per-feature grants",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Roles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRoleList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "access"
        ],
        "summary": "Create a custom role (workspace admins; ≤20 live custom roles)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "grants"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9-]*$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "defaultFor": {
                    "type": "string",
                    "enum": [
                      "",
                      "customer",
                      "persona"
                    ]
                  },
                  "grants": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/AccessGrant"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created role",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRoleEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/roles/{id}": {
      "patch": {
        "tags": [
          "access"
        ],
        "summary": "Edit a role (name/description/default/grants; the system admin role is immutable)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "defaultFor": {
                    "type": "string",
                    "enum": [
                      "",
                      "customer",
                      "persona"
                    ]
                  },
                  "grants": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/AccessGrant"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated role",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRoleEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "access"
        ],
        "summary": "Soft-delete a custom role (refused while assignments still reference it)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/assignments": {
      "get": {
        "tags": [
          "access"
        ],
        "summary": "List assignments (workspace-wide for admins; per-item for M holders)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "feature",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Assignments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessAssignmentList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "access"
        ],
        "summary": "Grant (or replace) a role for a subject at a scope — requires M + no-escalation",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "subjectKind",
                  "subjectId",
                  "roleId"
                ],
                "properties": {
                  "subjectKind": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "persona",
                      "team"
                    ]
                  },
                  "subjectId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "feature": {
                    "type": "string",
                    "description": "with itemId: scope the grant to one item"
                  },
                  "itemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "roleId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replaced assignment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessAssignmentEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Created assignment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessAssignmentEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/assignments/{id}": {
      "delete": {
        "tags": [
          "access"
        ],
        "summary": "Revoke an assignment (requires M at its scope)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/items/restrict": {
      "post": {
        "tags": [
          "access"
        ],
        "summary": "Mark an item RESTRICTED (workspace-scope grants stop applying to it)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "feature",
                  "itemId"
                ],
                "properties": {
                  "feature": {
                    "type": "string"
                  },
                  "itemId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Restriction state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRestriction"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/items/restore": {
      "post": {
        "tags": [
          "access"
        ],
        "summary": "Restore an item to inherited access (deletes its restriction row)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "feature",
                  "itemId"
                ],
                "properties": {
                  "feature": {
                    "type": "string"
                  },
                  "itemId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Restriction state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRestriction"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/effective": {
      "get": {
        "tags": [
          "access"
        ],
        "summary": "A subject's effective verbs + provenance (the explainer; requires M)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "feature",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subjectKind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subjectId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Effective access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessEffective"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/personas/{id}/tools": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List a persona's grantable tool catalog + each tool's grant/autonomy state",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "the grantable tool catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tools"
                  ],
                  "properties": {
                    "tools": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryPersonaToolCatalogItem"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Grant a tool to a persona (owner/admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "toolName"
                ],
                "properties": {
                  "toolName": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "the granted tool",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tool"
                  ],
                  "properties": {
                    "tool": {
                      "$ref": "#/components/schemas/RegistryPersonaToolCatalogItem"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/personas/{id}/tools/{toolName}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "toolName",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "tags": [
          "registry"
        ],
        "summary": "Set a tool grant's autonomy flag (404 if the tool isn't granted)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "autonomous"
                ],
                "properties": {
                  "autonomous": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "the updated grant",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tool"
                  ],
                  "properties": {
                    "tool": {
                      "$ref": "#/components/schemas/RegistryPersonaToolGrant"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "registry"
        ],
        "summary": "Revoke a tool from a persona (owner/admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "revoked (idempotent)"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/personas/user-actable": {
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List the personas the caller may configure per-tool toggles for (may_act user)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "the personas that may act for users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "personas"
                  ],
                  "properties": {
                    "personas": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryUserActablePersona"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/personas/{id}/user-tools": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List a persona's owner-granted tools + the caller's own per-tool allow toggle",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "the persona's granted tools annotated with the caller's toggle",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tools"
                  ],
                  "properties": {
                    "tools": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryPersonaUserTool"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "registry"
        ],
        "summary": "Replace the caller's allowed-tool set for this persona (all-on / all-off / per-tool)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "allowed"
                ],
                "properties": {
                  "allowed": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "the tools the caller allows the persona to invoke for them; every name must be one of the persona's owner-granted tools (400 otherwise). [] clears; all names = all-on."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "the updated per-user tool view",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tools"
                  ],
                  "properties": {
                    "tools": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistryPersonaUserTool"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/personas/{id}/may-act": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List the subject kinds a persona may act for (always includes seeded 'self')",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "the granted subject kinds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryPersonaMayAct"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registry"
        ],
        "summary": "Grant a may_act subject kind (user/team/org) to a persona (owner/admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "user",
                      "team",
                      "org"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "the granted subject kinds after the grant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryPersonaMayAct"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/personas/{id}/may-act/{kind}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "kind",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "registry"
        ],
        "summary": "Revoke a may_act subject kind (user/team/org) from a persona; 'self' → 400",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "revoked (idempotent)"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/team-reach": {
      "get": {
        "tags": [
          "access"
        ],
        "summary": "List the team reach grants INTO one ecosystem",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ecosystemId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "teamId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grants",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamReachGrantList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "access"
        ],
        "summary": "Grant a team reach into an ecosystem you manage",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ecosystemId",
                  "teamId",
                  "permission"
                ],
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "the ecosystem being reached INTO — uuid or `ecosystem.<slug>` rdid"
                  },
                  "teamId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36
                  },
                  "permission": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Granted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamReachGrant"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/team-reach/{id}": {
      "delete": {
        "tags": [
          "access"
        ],
        "summary": "Revoke a team reach grant (authorized on the grant's own ecosystem)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/storage/uploads": {
      "post": {
        "tags": [
          "storage"
        ],
        "summary": "Begin an upload: reserve an attachment + presigned PUT URL",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename",
                  "contentType"
                ],
                "properties": {
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "contentType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "parentType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32,
                    "description": "Kind of row the attachment hangs off, e.g. 'persona' or 'registry.entry' (defaults to 'standalone')."
                  },
                  "parentId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "description": "Id of the row the attachment hangs off."
                  },
                  "ownerType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32,
                    "deprecated": true,
                    "description": "Legacy name for parentType; read only when parentType is absent."
                  },
                  "ownerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "deprecated": true,
                    "description": "Legacy name for parentId; read only when parentId is absent."
                  },
                  "ecosystemId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 36,
                    "nullable": true
                  },
                  "sizeBytes": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Declared size; enforced against the storage quota at init."
                  },
                  "contentHash": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "When it matches an existing ready object, the upload is deduplicated."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deduplicated — an identical object already exists; no new upload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageDeduplicated"
                }
              }
            }
          },
          "201": {
            "description": "Pending attachment + presigned PUT URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoragePresignedUpload"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Storage quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageQuotaExceeded"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "storage"
        ],
        "summary": "List the caller's attachments (newest first)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "parentType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "parentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attachments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StorageAttachment"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/storage/uploads/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "storage"
        ],
        "summary": "Get one of the caller's attachments by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageAttachment"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "storage"
        ],
        "summary": "Delete an attachment (removes the R2 object, then the row)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/storage/uploads/{id}/complete": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "storage"
        ],
        "summary": "Confirm an upload completed → mark the attachment ready",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Finalized (ready) attachment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageAttachmentEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/storage/downloads/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "storage"
        ],
        "summary": "Get a presigned download URL for an attachment",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Presigned download URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageDownload"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sync/pull": {
      "get": {
        "summary": "Delta-pull all changed rows for the caller across sync-registered resources",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max changes to return. Clamped server-side to 1..1000 regardless of the value supplied (non-finite or omitted values fall back to the default). Default 500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Changes since the cursor, ordered by syncVersion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncPullResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sync/push": {
      "post": {
        "summary": "Idempotent batch apply of offline mutations (LWW, delete-wins)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncPushRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-op results + watermark",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncPushResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/admin/sync/tables/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Ecosystem rdid or uuid"
        }
      ],
      "get": {
        "tags": [
          "sync"
        ],
        "summary": "List an ecosystem's sync enrollment, default and effective",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every catalog resource with its effective state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncEnrollmentList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/admin/sync/tables/{id}/{resource}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Ecosystem rdid or uuid"
        },
        {
          "name": "resource",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "\"<schema>.<table>\" from the catalog"
        }
      ],
      "put": {
        "tags": [
          "sync"
        ],
        "summary": "Override whether one resource syncs for an ecosystem",
        "description": "A resource that is not in the catalog is a 400 — overrides cannot invent resources.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncEnrollmentUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The catalog after the write",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncEnrollmentList"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "sync"
        ],
        "summary": "Drop the override and fall back to the catalog default",
        "description": "Idempotent, and deliberately unvalidated: clearing an override that was never set — or one naming a resource the catalog has since dropped — succeeds rather than 400ing, so a stale override can always be cleaned up.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The catalog after the clear",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncEnrollmentList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/themes": {
      "get": {
        "tags": [
          "themes"
        ],
        "summary": "List every live theme (suite-wide; empty in production)",
        "responses": {
          "200": {
            "description": "Live themes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Theme"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/public/themes/{key}": {
      "parameters": [
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "themes"
        ],
        "summary": "Get one live theme by key",
        "responses": {
          "200": {
            "description": "A theme",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Theme"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/themes": {
      "post": {
        "tags": [
          "themes"
        ],
        "summary": "Create a live theme (staging/testing only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "label",
                  "data"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "DNS-ish slug, unique among live themes"
                  },
                  "label": {
                    "type": "string"
                  },
                  "basedOn": {
                    "type": "string",
                    "nullable": true,
                    "description": "the seed theme key this derives from"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created theme",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Theme"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/themes/{key}": {
      "parameters": [
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "tags": [
          "themes"
        ],
        "summary": "Update a live theme (staging/testing only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "basedOn": {
                    "type": "string",
                    "nullable": true
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated theme",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Theme"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "themes"
        ],
        "summary": "Soft-delete a live theme (staging/testing only)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/costs": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Cost report from the daily rollup (admin)",
        "description": "Sums `usage.cost_daily` over `from`..`to` (both inclusive, at most 366 days — wider is a 400), one row per day or per spend key. Money is integer µUSD; a non-zero `unpricedLines` means `costMicros` is a floor. `ecosystemId=platform` selects platform-level spend (the nil uuid key).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ecosystemId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "An ecosystem uuid, or `platform` for platform-level spend"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Only this spend category",
            "schema": {
              "type": "string",
              "enum": [
                "llm",
                "embedding",
                "email",
                "sms",
                "storage_op",
                "outbound_http",
                "realtime"
              ]
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paidBy",
            "in": "query",
            "required": false,
            "description": "Only this payer",
            "schema": {
              "type": "string",
              "enum": [
                "platform",
                "customer_key"
              ]
            }
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "description": "One row per day (default) or per spend key",
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "key"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Summed cost rows",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageCostReport"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/costs/calls/{callId}": {
      "parameters": [
        {
          "name": "callId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The call id (x-request-id), a uuid"
        }
      ],
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "One call's cost ledger and its child calls' (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The call ledger",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageCallReport"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/enforcement": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Effective usage-enforcement switch + pricing knobs (admin)",
        "description": "The global kill switch above every tier’s `quota_enforced`, with the input that decided it: `USAGE_ENFORCEMENT_ENABLED` wins when set, otherwise the `usage_enforcement` row in `system.feature_flags` (absent ⇒ off). Also reports the environment-only pricing and retention knobs, which govern what enforcement charges once it bites, plus the visitor floor’s two daily budgets — the only caps that refuse whatever `enabled` says. Writes go to `/system/feature-flags` — POST when `flag` is null, PUT `/{flag.id}` otherwise.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Effective switch, its provenance, and the pricing knobs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageEnforcement"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/summary": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Current-period usage per principal (self, or a workspace)",
        "description": "Without `workspace`: the caller (self + API tokens + owned personas). With `workspace`: that workspace's principals — a personal workspace resolves only for its owner; an organization returns its member roster plus org-owned personas and requires workspace admin. The ecosystem's billing row is appended for platform admins only.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usage rows for the current period",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageSummary"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/storage": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Get the caller's storage quota + current usage",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Quota summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageStorageQuota"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/storage/{userId}": {
      "parameters": [
        {
          "name": "userId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Get a user's storage quota + usage (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Quota summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageStorageQuota"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "usage"
        ],
        "summary": "Set a user's storage quota override (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "quotaBytes"
                ],
                "properties": {
                  "quotaBytes": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "New quota in bytes (non-negative)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upserted quota override row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageStorageQuotaRow"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/rates": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Every price, newest effective day first (admin)",
        "description": "The rates the insight reports price usage with.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The rates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageRateList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "usage"
        ],
        "summary": "Add a price (admin)",
        "description": "A price change is a new row from the day it takes effect. `microsPerUnit` is exact decimal text. 409 when a rate for that item, quantity key and start day exists.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsageRateCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The rate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageRate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/rates/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The row id"
        }
      ],
      "patch": {
        "tags": [
          "usage"
        ],
        "summary": "Edit a price that has not taken effect yet (admin)",
        "description": "Only while `effectiveFrom` is today (UTC) or later; else 409 `past rates are immutable — add a new rate`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsageRatePatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageRate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "usage"
        ],
        "summary": "Delete a price that has not taken effect yet (admin)",
        "description": "Only while `effectiveFrom` is today (UTC) or later; else 409 `past rates are immutable — add a new rate`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/fixed-costs": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Every fixed monthly cost, newest first (admin)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The fixed costs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageFixedCostList"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "usage"
        ],
        "summary": "Add a fixed monthly cost (admin)",
        "description": "`effectiveTo`, when set, is inclusive and not before `effectiveFrom`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsageFixedCostCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The fixed cost",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageFixedCost"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/fixed-costs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The row id"
        }
      ],
      "patch": {
        "tags": [
          "usage"
        ],
        "summary": "End, annotate or (before it starts) edit a fixed cost (admin)",
        "description": "`effectiveTo` (inclusive; may be in the past — the correction path for a mistaken open row), `label` and `note` may always change. `monthlyMicros` and `effectiveFrom` only while `effectiveFrom` is today (UTC) or later, else 409 `a fixed cost already in effect is immutable except to end it or annotate it — end it and add a new row`. `effectiveTo` before `effectiveFrom` is a 400.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsageFixedCostPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The fixed cost",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageFixedCost"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "usage"
        ],
        "summary": "Delete a fixed cost that has not started yet (admin)",
        "description": "Only while `effectiveFrom` is today (UTC) or later; else 409 `a fixed cost already in effect is immutable except to end it or annotate it — end it and add a new row`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/insight/run-rate": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "A month's run rate: direct to date, fixed, projected (admin)",
        "description": "`month` is YYYY-MM; a future month is a 400. The current month counts its days through yesterday (UTC) — today is still being written.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The run rate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageInsightRunRate"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/insight/items": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Every cost item seen in a range, priced (admin)",
        "description": "`from`..`to` are YYYY-MM-DD, both inclusive, at most 366 days — wider is a 400. Sorted by cost, highest first; unpriced items sort below priced ones.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The priced items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageInsightItems"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/insight/overview": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Platform usage and direct cost as a time series (admin)",
        "description": "`from`..`to` are YYYY-MM-DD, both inclusive, at most 366 days — wider is a 400. One point per bucket the range touches, empty ones included.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "description": "Bucket size (default day)",
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageInsightOverview"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/insight/breakdown": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Usage and cost per organization, ecosystem, user or persona (admin)",
        "description": "`from`..`to` are YYYY-MM-DD, both inclusive, at most 366 days — wider is a 400. One row per key; a persona call on a user's behalf counts under both. `limit` is 1–200 (default 50).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "by",
            "in": "query",
            "required": true,
            "description": "The dimension",
            "schema": {
              "type": "string",
              "enum": [
                "organization",
                "ecosystem",
                "user",
                "persona"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Highest first (default direct)",
            "schema": {
              "type": "string",
              "enum": [
                "direct",
                "estimated",
                "requests"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The breakdown page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageInsightBreakdown"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/insight/breakdown/{by}/{key}": {
      "parameters": [
        {
          "name": "by",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "organization",
              "ecosystem",
              "user",
              "persona"
            ]
          },
          "description": "The dimension"
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The dimension key, a uuid (the nil uuid is the unattributed row)"
        }
      ],
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "One breakdown key's items and daily trend (admin)",
        "description": "`from`..`to` are YYYY-MM-DD, both inclusive, at most 366 days — wider is a 400.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The key detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageInsightBreakdownDetail"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces": {
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List the caller's workspaces (individual first, then orgs, then teams)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The caller workspaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Workspace"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/archived": {
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "List the caller's archived organizations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The caller archived workspaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ArchivedWorkspace"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/{slug}/members": {
      "parameters": [
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "registry"
        ],
        "summary": "An organization workspace's roster: the distinct customers across the org's org-owned teams",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The organization members",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "members"
                  ],
                  "properties": {
                    "members": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WorkspaceMember"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/team-permissions": {
      "x-exposure": "admin",
      "get": {
        "tags": [
          "access"
        ],
        "summary": "List team_permissions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "teamId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "permission": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "grantedBy": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "grantedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "teamId",
                      "permission",
                      "grantedBy",
                      "grantedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "access"
        ],
        "summary": "Create team_permissions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "teamId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "permission": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "grantedAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "teamId",
                  "permission",
                  "grantedAt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "team_permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "teamId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "permission": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "grantedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "grantedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "teamId",
                    "permission",
                    "grantedBy",
                    "grantedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/access/team-permissions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "access"
        ],
        "summary": "Get team_permissions by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "team_permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "teamId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "permission": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "grantedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "grantedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "teamId",
                    "permission",
                    "grantedBy",
                    "grantedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "access"
        ],
        "summary": "Update team_permissions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "teamId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "permission": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "grantedAt": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "team_permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "teamId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "permission": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "grantedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "grantedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "teamId",
                    "permission",
                    "grantedBy",
                    "grantedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "access"
        ],
        "summary": "Delete team_permissions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/lists": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "audience"
        ],
        "summary": "List lists",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "createdBy": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "publicKey": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "welcomeTemplateId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "welcomeBackTemplateId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "fromName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "createdBy",
                      "authorKind",
                      "authorId",
                      "name",
                      "slug",
                      "description",
                      "publicKey",
                      "status",
                      "welcomeTemplateId",
                      "welcomeBackTemplateId",
                      "fromName",
                      "isDeleted",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "audience"
        ],
        "summary": "Create lists",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "welcomeTemplateId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "welcomeBackTemplateId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fromName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "slug"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "lists",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publicKey": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "welcomeTemplateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "welcomeBackTemplateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fromName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "createdBy",
                    "authorKind",
                    "authorId",
                    "name",
                    "slug",
                    "description",
                    "publicKey",
                    "status",
                    "welcomeTemplateId",
                    "welcomeBackTemplateId",
                    "fromName",
                    "isDeleted",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/lists/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "audience"
        ],
        "summary": "Get lists by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "lists",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publicKey": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "welcomeTemplateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "welcomeBackTemplateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fromName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "createdBy",
                    "authorKind",
                    "authorId",
                    "name",
                    "slug",
                    "description",
                    "publicKey",
                    "status",
                    "welcomeTemplateId",
                    "welcomeBackTemplateId",
                    "fromName",
                    "isDeleted",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "audience"
        ],
        "summary": "Update lists",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "welcomeTemplateId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "welcomeBackTemplateId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fromName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "lists",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publicKey": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "welcomeTemplateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "welcomeBackTemplateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fromName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "createdBy",
                    "authorKind",
                    "authorId",
                    "name",
                    "slug",
                    "description",
                    "publicKey",
                    "status",
                    "welcomeTemplateId",
                    "welcomeBackTemplateId",
                    "fromName",
                    "isDeleted",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "audience"
        ],
        "summary": "Delete lists",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/templates": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "audience"
        ],
        "summary": "List templates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "createdBy": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "subject": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "htmlBody": {
                        "type": "string"
                      },
                      "textBody": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "createdBy",
                      "authorKind",
                      "authorId",
                      "name",
                      "subject",
                      "htmlBody",
                      "textBody",
                      "kind",
                      "isDeleted",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "audience"
        ],
        "summary": "Create templates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "subject": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "htmlBody": {
                    "type": "string"
                  },
                  "textBody": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 20
                  }
                },
                "required": [
                  "name",
                  "subject",
                  "htmlBody",
                  "textBody"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "templates",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "subject": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "htmlBody": {
                      "type": "string"
                    },
                    "textBody": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "createdBy",
                    "authorKind",
                    "authorId",
                    "name",
                    "subject",
                    "htmlBody",
                    "textBody",
                    "kind",
                    "isDeleted",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audience/templates/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "audience"
        ],
        "summary": "Get templates by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "templates",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "subject": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "htmlBody": {
                      "type": "string"
                    },
                    "textBody": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "createdBy",
                    "authorKind",
                    "authorId",
                    "name",
                    "subject",
                    "htmlBody",
                    "textBody",
                    "kind",
                    "isDeleted",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "audience"
        ],
        "summary": "Update templates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "subject": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "htmlBody": {
                    "type": "string"
                  },
                  "textBody": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 20
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "templates",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "subject": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "htmlBody": {
                      "type": "string"
                    },
                    "textBody": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "createdBy",
                    "authorKind",
                    "authorId",
                    "name",
                    "subject",
                    "htmlBody",
                    "textBody",
                    "kind",
                    "isDeleted",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "audience"
        ],
        "summary": "Delete templates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/offers": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "List offers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "purpose": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "stripePriceId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "stripeProductId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "collectionMethod": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "daysUntilDue": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "grantsEcosystemId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "lapseAction": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "graceDays": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "isActive": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "slug",
                      "name",
                      "description",
                      "purpose",
                      "stripePriceId",
                      "stripeProductId",
                      "collectionMethod",
                      "daysUntilDue",
                      "grantsEcosystemId",
                      "lapseAction",
                      "graceDays",
                      "isActive",
                      "createdAt",
                      "updatedAt",
                      "deletedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Create offers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "purpose": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "stripePriceId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "stripeProductId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "collectionMethod": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "daysUntilDue": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "grantsEcosystemId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lapseAction": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "graceDays": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "isActive": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "slug",
                  "name",
                  "stripePriceId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "offers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "purpose": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "stripePriceId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "stripeProductId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "collectionMethod": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "daysUntilDue": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "grantsEcosystemId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lapseAction": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "graceDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "name",
                    "description",
                    "purpose",
                    "stripePriceId",
                    "stripeProductId",
                    "collectionMethod",
                    "daysUntilDue",
                    "grantsEcosystemId",
                    "lapseAction",
                    "graceDays",
                    "isActive",
                    "createdAt",
                    "updatedAt",
                    "deletedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/offers/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Get offers by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "offers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "purpose": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "stripePriceId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "stripeProductId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "collectionMethod": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "daysUntilDue": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "grantsEcosystemId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lapseAction": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "graceDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "name",
                    "description",
                    "purpose",
                    "stripePriceId",
                    "stripeProductId",
                    "collectionMethod",
                    "daysUntilDue",
                    "grantsEcosystemId",
                    "lapseAction",
                    "graceDays",
                    "isActive",
                    "createdAt",
                    "updatedAt",
                    "deletedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "billing"
        ],
        "summary": "Update offers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "purpose": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "stripePriceId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "stripeProductId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "collectionMethod": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "daysUntilDue": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "grantsEcosystemId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lapseAction": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "graceDays": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "isActive": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "offers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "purpose": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "stripePriceId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "stripeProductId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "collectionMethod": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "daysUntilDue": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "grantsEcosystemId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lapseAction": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "graceDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "name",
                    "description",
                    "purpose",
                    "stripePriceId",
                    "stripeProductId",
                    "collectionMethod",
                    "daysUntilDue",
                    "grantsEcosystemId",
                    "lapseAction",
                    "graceDays",
                    "isActive",
                    "createdAt",
                    "updatedAt",
                    "deletedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "billing"
        ],
        "summary": "Delete offers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/subscription-tiers": {
      "x-exposure": "catalog",
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "List subscription_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "key": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "displayOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "isActive": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "key",
                      "name",
                      "description",
                      "displayOrder",
                      "isActive",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Create subscription_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "displayOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "isActive": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "key",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "subscription_tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "key",
                    "name",
                    "description",
                    "displayOrder",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/subscription-tiers/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Get subscription_tiers by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "subscription_tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "key",
                    "name",
                    "description",
                    "displayOrder",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "billing"
        ],
        "summary": "Update subscription_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "displayOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "isActive": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "subscription_tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "key",
                    "name",
                    "description",
                    "displayOrder",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "billing"
        ],
        "summary": "Delete subscription_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/subscriptions": {
      "x-exposure": "catalog",
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "List subscriptions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "userId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "tierId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "startedAt": {
                        "type": "string"
                      },
                      "expiresAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "assignedBy": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "userId",
                      "ecosystemId",
                      "tierId",
                      "status",
                      "source",
                      "startedAt",
                      "expiresAt",
                      "assignedBy",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Create subscriptions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "tierId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "startedAt": {
                    "type": "string"
                  },
                  "expiresAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "tierId",
                  "startedAt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "subscriptions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "tierId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "startedAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "ecosystemId",
                    "tierId",
                    "status",
                    "source",
                    "startedAt",
                    "expiresAt",
                    "assignedBy",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/subscriptions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Get subscriptions by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "subscriptions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "tierId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "startedAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "ecosystemId",
                    "tierId",
                    "status",
                    "source",
                    "startedAt",
                    "expiresAt",
                    "assignedBy",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "billing"
        ],
        "summary": "Update subscriptions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "tierId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "startedAt": {
                    "type": "string"
                  },
                  "expiresAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "subscriptions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "tierId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "startedAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "ecosystemId",
                    "tierId",
                    "status",
                    "source",
                    "startedAt",
                    "expiresAt",
                    "assignedBy",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "billing"
        ],
        "summary": "Delete subscriptions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/tier-entitlements": {
      "x-exposure": "catalog",
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "List tier_entitlements",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "tierId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "entitlementKey": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "valueType": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "value": {
                        "type": "string",
                        "maxLength": 64
                      }
                    },
                    "required": [
                      "id",
                      "tierId",
                      "entitlementKey",
                      "valueType",
                      "value"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Create tier_entitlements",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "tierId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "entitlementKey": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "valueType": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "tierId",
                  "entitlementKey",
                  "valueType",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "tier_entitlements",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "tierId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "entitlementKey": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "valueType": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 64
                    }
                  },
                  "required": [
                    "id",
                    "tierId",
                    "entitlementKey",
                    "valueType",
                    "value"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/tier-entitlements/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Get tier_entitlements by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "tier_entitlements",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "tierId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "entitlementKey": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "valueType": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 64
                    }
                  },
                  "required": [
                    "id",
                    "tierId",
                    "entitlementKey",
                    "valueType",
                    "value"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "billing"
        ],
        "summary": "Update tier_entitlements",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "tierId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "entitlementKey": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "valueType": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "tier_entitlements",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "tierId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "entitlementKey": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "valueType": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 64
                    }
                  },
                  "required": [
                    "id",
                    "tierId",
                    "entitlementKey",
                    "valueType",
                    "value"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "billing"
        ],
        "summary": "Delete tier_entitlements",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/bucket-types": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "List bucket_types",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "ecosystemId": {
                        "type": "string"
                      },
                      "bucketId": {
                        "type": "string"
                      },
                      "sqlTableName": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "description": {
                        "type": "string"
                      },
                      "refMode": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "metadata": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "bucketId",
                      "sqlTableName",
                      "name",
                      "description",
                      "refMode",
                      "metadata",
                      "createdAt",
                      "updatedAt",
                      "deletedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "bucket"
        ],
        "summary": "Create bucket_types",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string"
                  },
                  "bucketId": {
                    "type": "string"
                  },
                  "sqlTableName": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "description": {
                    "type": "string"
                  },
                  "refMode": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "bucketId",
                  "sqlTableName",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "bucket_types",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "bucketId": {
                      "type": "string"
                    },
                    "sqlTableName": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "description": {
                      "type": "string"
                    },
                    "refMode": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "bucketId",
                    "sqlTableName",
                    "name",
                    "description",
                    "refMode",
                    "metadata",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/bucket-types/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "Get bucket_types by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "bucket_types",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "bucketId": {
                      "type": "string"
                    },
                    "sqlTableName": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "description": {
                      "type": "string"
                    },
                    "refMode": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "bucketId",
                    "sqlTableName",
                    "name",
                    "description",
                    "refMode",
                    "metadata",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "bucket"
        ],
        "summary": "Update bucket_types",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string"
                  },
                  "bucketId": {
                    "type": "string"
                  },
                  "sqlTableName": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "description": {
                    "type": "string"
                  },
                  "refMode": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "bucket_types",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "bucketId": {
                      "type": "string"
                    },
                    "sqlTableName": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "description": {
                      "type": "string"
                    },
                    "refMode": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "bucketId",
                    "sqlTableName",
                    "name",
                    "description",
                    "refMode",
                    "metadata",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "bucket"
        ],
        "summary": "Delete bucket_types",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/buckets": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "List buckets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "ecosystemId": {
                        "type": "string"
                      },
                      "parentId": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "description": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "metadata": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "parentId",
                      "name",
                      "slug",
                      "description",
                      "kind",
                      "metadata",
                      "createdAt",
                      "updatedAt",
                      "deletedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "bucket"
        ],
        "summary": "Create buckets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string"
                  },
                  "parentId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "description": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "slug"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "buckets",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "description": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "parentId",
                    "name",
                    "slug",
                    "description",
                    "kind",
                    "metadata",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bucket/buckets/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "bucket"
        ],
        "summary": "Get buckets by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "buckets",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "description": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "parentId",
                    "name",
                    "slug",
                    "description",
                    "kind",
                    "metadata",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "bucket"
        ],
        "summary": "Update buckets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string"
                  },
                  "parentId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "description": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "buckets",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "description": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "parentId",
                    "name",
                    "slug",
                    "description",
                    "kind",
                    "metadata",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "bucket"
        ],
        "summary": "Delete buckets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/addresses": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List addresses",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "label": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "line1": {
                        "type": "string",
                        "maxLength": 300
                      },
                      "line2": {
                        "type": "string",
                        "maxLength": 300
                      },
                      "city": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "region": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "postalCode": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "country": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "deletedAt",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "label",
                      "line1",
                      "line2",
                      "city",
                      "region",
                      "postalCode",
                      "country",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create addresses",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "line1": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "line2": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "postalCode": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "country": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "addresses",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "line1": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "line2": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "city": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "region": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "postalCode": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "country": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "label",
                    "line1",
                    "line2",
                    "city",
                    "region",
                    "postalCode",
                    "country",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      }
    },
    "/content/addresses/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get addresses by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "addresses",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "line1": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "line2": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "city": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "region": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "postalCode": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "country": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "label",
                    "line1",
                    "line2",
                    "city",
                    "region",
                    "postalCode",
                    "country",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update addresses",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "line1": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "line2": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "postalCode": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "country": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "addresses",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "line1": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "line2": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "city": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "region": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "postalCode": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "country": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "label",
                    "line1",
                    "line2",
                    "city",
                    "region",
                    "postalCode",
                    "country",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete addresses",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      }
    },
    "/content/categories": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List categories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "description": {
                        "type": "string"
                      },
                      "color": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "icon": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "sortOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "name",
                      "description",
                      "color",
                      "icon",
                      "sortOrder",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create categories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  },
                  "color": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "icon": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "categories",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "icon": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "name",
                    "description",
                    "color",
                    "icon",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/categories/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get categories by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "categories",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "icon": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "name",
                    "description",
                    "color",
                    "icon",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update categories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  },
                  "color": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "icon": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "categories",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "icon": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "name",
                    "description",
                    "color",
                    "icon",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete categories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/category-edges": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List category_edges",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "parentId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "childId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "sortOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "parentId",
                      "childId",
                      "sortOrder",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create category_edges",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "parentId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "childId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "parentId",
                  "childId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "category_edges",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "parentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "childId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "parentId",
                    "childId",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/category-edges/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get category_edges by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "category_edges",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "parentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "childId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "parentId",
                    "childId",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update category_edges",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "parentId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "childId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "category_edges",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "parentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "childId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "parentId",
                    "childId",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete category_edges",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/category-items": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List category_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "categoryId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "targetKind": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "targetId": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "sortOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "categoryId",
                      "targetKind",
                      "targetId",
                      "sortOrder",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create category_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "categoryId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "targetKind": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "targetId": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "categoryId",
                  "targetKind",
                  "targetId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "category_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "categoryId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "targetKind": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "targetId": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "categoryId",
                    "targetKind",
                    "targetId",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/category-items/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get category_items by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "category_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "categoryId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "targetKind": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "targetId": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "categoryId",
                    "targetKind",
                    "targetId",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update category_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "categoryId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "targetKind": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "targetId": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "category_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "categoryId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "targetKind": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "targetId": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "categoryId",
                    "targetKind",
                    "targetId",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete category_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/contacts": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List contacts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "personUserId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "fullName": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "nickname": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "email": {
                        "type": "string",
                        "maxLength": 320
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "notes": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "deletedAt",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "personUserId",
                      "fullName",
                      "nickname",
                      "email",
                      "phone",
                      "notes",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create contacts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "personUserId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fullName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "nickname": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 320
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "contacts",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "personUserId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fullName": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "nickname": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "email": {
                      "type": "string",
                      "maxLength": 320
                    },
                    "phone": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "personUserId",
                    "fullName",
                    "nickname",
                    "email",
                    "phone",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/contacts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get contacts by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "contacts",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "personUserId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fullName": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "nickname": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "email": {
                      "type": "string",
                      "maxLength": 320
                    },
                    "phone": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "personUserId",
                    "fullName",
                    "nickname",
                    "email",
                    "phone",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update contacts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "personUserId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fullName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "nickname": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 320
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "contacts",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "personUserId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fullName": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "nickname": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "email": {
                      "type": "string",
                      "maxLength": 320
                    },
                    "phone": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "personUserId",
                    "fullName",
                    "nickname",
                    "email",
                    "phone",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete contacts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/counters": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List counters",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "value": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "name",
                      "value",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create counters",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "value": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "name",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "counters",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "value": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "value",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/counters/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get counters by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "counters",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "value": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "value",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update counters",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "value": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "counters",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "value": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "value",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete counters",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/dates": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List dates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "label": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "date": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "recurrence": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "contactId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "notes": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "deletedAt",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "label",
                      "date",
                      "recurrence",
                      "contactId",
                      "notes",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create dates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "date": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "recurrence": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "contactId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "dates",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "date": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "recurrence": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "contactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "label",
                    "date",
                    "recurrence",
                    "contactId",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/dates/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get dates by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "dates",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "date": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "recurrence": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "contactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "label",
                    "date",
                    "recurrence",
                    "contactId",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update dates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "date": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "recurrence": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "contactId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "dates",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "date": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "recurrence": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "contactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "label",
                    "date",
                    "recurrence",
                    "contactId",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete dates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/events": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "payload": {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "type",
                      "payload",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "payload": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "payload": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "type",
                    "payload",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/events/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get events by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "payload": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "type",
                    "payload",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "payload": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "payload": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "type",
                    "payload",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/feedback": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List feedback",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "userEmail": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "subject": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "body": {
                        "type": "string"
                      },
                      "platform": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "appVersion": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "osVersion": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "deviceInfo": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "adminNotes": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "userEmail",
                      "category",
                      "subject",
                      "body",
                      "platform",
                      "appVersion",
                      "osVersion",
                      "deviceInfo",
                      "status",
                      "adminNotes",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create feedback",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "userEmail": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "subject": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "body": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "appVersion": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "osVersion": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "deviceInfo": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "adminNotes": {
                    "type": "string"
                  }
                },
                "required": [
                  "userEmail",
                  "category",
                  "subject",
                  "body",
                  "platform"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "feedback",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userEmail": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "subject": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "body": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "appVersion": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "osVersion": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "deviceInfo": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "adminNotes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "userEmail",
                    "category",
                    "subject",
                    "body",
                    "platform",
                    "appVersion",
                    "osVersion",
                    "deviceInfo",
                    "status",
                    "adminNotes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/feedback/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get feedback by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "feedback",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userEmail": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "subject": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "body": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "appVersion": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "osVersion": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "deviceInfo": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "adminNotes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "userEmail",
                    "category",
                    "subject",
                    "body",
                    "platform",
                    "appVersion",
                    "osVersion",
                    "deviceInfo",
                    "status",
                    "adminNotes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update feedback",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "userEmail": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "subject": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "body": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "appVersion": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "osVersion": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "deviceInfo": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "adminNotes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "feedback",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userEmail": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "subject": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "body": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "appVersion": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "osVersion": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "deviceInfo": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "adminNotes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "userEmail",
                    "category",
                    "subject",
                    "body",
                    "platform",
                    "appVersion",
                    "osVersion",
                    "deviceInfo",
                    "status",
                    "adminNotes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete feedback",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/key-value-pairs": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List key_value_pairs",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "key": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "value": {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "key",
                      "value",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create key_value_pairs",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "key": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "key_value_pairs",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "key",
                    "value",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/key-value-pairs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get key_value_pairs by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "key_value_pairs",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "key",
                    "value",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update key_value_pairs",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "key": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "key_value_pairs",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "key",
                    "value",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete key_value_pairs",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/keyword-items": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List keyword_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "keywordId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "targetKind": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "targetId": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "sortOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "keywordId",
                      "targetKind",
                      "targetId",
                      "sortOrder",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create keyword_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "keywordId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "targetKind": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "targetId": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "keywordId",
                  "targetKind",
                  "targetId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "keyword_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "keywordId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "targetKind": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "targetId": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "keywordId",
                    "targetKind",
                    "targetId",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/keyword-items/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get keyword_items by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "keyword_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "keywordId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "targetKind": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "targetId": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "keywordId",
                    "targetKind",
                    "targetId",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update keyword_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "keywordId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "targetKind": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "targetId": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "keyword_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "keywordId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "targetKind": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "targetId": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "keywordId",
                    "targetKind",
                    "targetId",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete keyword_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/keywords": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List keywords",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "label": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "color": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "description": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "label",
                      "color",
                      "description",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create keywords",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "color": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "required": [
                  "label"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "keywords",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "description": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "label",
                    "color",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/keywords/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get keywords by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "keywords",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "description": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "label",
                    "color",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update keywords",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "color": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "keywords",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "description": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "label",
                    "color",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete keywords",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/list-items": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List list_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "listId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "position": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "value": {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "listId",
                      "position",
                      "value",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create list_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "listId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "position": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  }
                },
                "required": [
                  "listId",
                  "position",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "list_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "listId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "listId",
                    "position",
                    "value",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/list-items/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get list_items by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "list_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "listId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "listId",
                    "position",
                    "value",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update list_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "listId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "position": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "list_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "listId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "listId",
                    "position",
                    "value",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete list_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/lists": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List lists",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "description": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "name",
                      "description",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create lists",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "lists",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/lists/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get lists by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "lists",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update lists",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "lists",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete lists",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/locations": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List locations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "place": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "region": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "country": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "startDate": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "endDate": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 32
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "notes": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "deletedAt",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "place",
                      "region",
                      "country",
                      "startDate",
                      "endDate",
                      "notes",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create locations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "place": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "country": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "startDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "locations",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "place": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "region": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "country": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "startDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "place",
                    "region",
                    "country",
                    "startDate",
                    "endDate",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/locations/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get locations by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "locations",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "place": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "region": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "country": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "startDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "place",
                    "region",
                    "country",
                    "startDate",
                    "endDate",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update locations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "place": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "country": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "startDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "locations",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "place": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "region": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "country": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "startDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "place",
                    "region",
                    "country",
                    "startDate",
                    "endDate",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete locations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/poll-options": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List poll_options",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "pollId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "text": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "sortOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "pollId",
                      "text",
                      "sortOrder",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create poll_options",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "pollId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "pollId",
                  "text"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "poll_options",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pollId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "pollId",
                    "text",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/poll-options/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get poll_options by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "poll_options",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pollId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "pollId",
                    "text",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update poll_options",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "pollId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "poll_options",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pollId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "pollId",
                    "text",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete poll_options",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/polls": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List polls",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "hostKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 100
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "hostId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 128
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "question": {
                        "type": "string"
                      },
                      "allowMultiple": {
                        "type": "boolean"
                      },
                      "expiresAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "hostKind",
                      "hostId",
                      "question",
                      "allowMultiple",
                      "expiresAt",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create polls",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "hostKind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hostId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 128
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "question": {
                    "type": "string"
                  },
                  "allowMultiple": {
                    "type": "boolean"
                  },
                  "expiresAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "question"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "polls",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "hostKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "hostId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "question": {
                      "type": "string"
                    },
                    "allowMultiple": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "hostKind",
                    "hostId",
                    "question",
                    "allowMultiple",
                    "expiresAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/polls/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get polls by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "polls",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "hostKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "hostId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "question": {
                      "type": "string"
                    },
                    "allowMultiple": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "hostKind",
                    "hostId",
                    "question",
                    "allowMultiple",
                    "expiresAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update polls",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "hostKind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hostId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 128
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "question": {
                    "type": "string"
                  },
                  "allowMultiple": {
                    "type": "boolean"
                  },
                  "expiresAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "polls",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "hostKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "hostId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "question": {
                      "type": "string"
                    },
                    "allowMultiple": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "hostKind",
                    "hostId",
                    "question",
                    "allowMultiple",
                    "expiresAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete polls",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/queue-items": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List queue_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "queueId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "payload": {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "enqueuedAt": {
                        "type": "string"
                      },
                      "dequeuedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ackedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "nackedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "queueId",
                      "payload",
                      "status",
                      "enqueuedAt",
                      "dequeuedAt",
                      "ackedAt",
                      "nackedAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create queue_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "queueId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "payload": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "enqueuedAt": {
                    "type": "string"
                  },
                  "dequeuedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ackedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "nackedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "queueId",
                  "payload",
                  "status",
                  "enqueuedAt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "queue_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "queueId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "payload": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "enqueuedAt": {
                      "type": "string"
                    },
                    "dequeuedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ackedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "nackedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "queueId",
                    "payload",
                    "status",
                    "enqueuedAt",
                    "dequeuedAt",
                    "ackedAt",
                    "nackedAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/queue-items/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get queue_items by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "queue_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "queueId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "payload": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "enqueuedAt": {
                      "type": "string"
                    },
                    "dequeuedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ackedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "nackedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "queueId",
                    "payload",
                    "status",
                    "enqueuedAt",
                    "dequeuedAt",
                    "ackedAt",
                    "nackedAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update queue_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "queueId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "payload": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "enqueuedAt": {
                    "type": "string"
                  },
                  "dequeuedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ackedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "nackedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "queue_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "queueId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "payload": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "enqueuedAt": {
                      "type": "string"
                    },
                    "dequeuedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ackedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "nackedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "queueId",
                    "payload",
                    "status",
                    "enqueuedAt",
                    "dequeuedAt",
                    "ackedAt",
                    "nackedAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete queue_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/queues": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List queues",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "name",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create queues",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "queues",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/queues/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get queues by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "queues",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update queues",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "queues",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete queues",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/relationships": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List relationships",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "contactId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "relationshipKind": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "sinceDate": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "notes": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "deletedAt",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "contactId",
                      "relationshipKind",
                      "sinceDate",
                      "notes",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create relationships",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "contactId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "relationshipKind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "sinceDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "contactId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "relationships",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "contactId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "relationshipKind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "sinceDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "contactId",
                    "relationshipKind",
                    "sinceDate",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/relationships/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get relationships by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "relationships",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "contactId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "relationshipKind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "sinceDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "contactId",
                    "relationshipKind",
                    "sinceDate",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update relationships",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "contactId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "relationshipKind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "sinceDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "relationships",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "contactId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "relationshipKind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "sinceDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "contactId",
                    "relationshipKind",
                    "sinceDate",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete relationships",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/social-links": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List social_links",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "platform": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "url": {
                        "type": "string",
                        "maxLength": 1024
                      },
                      "handle": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "sortOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "deletedAt",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "platform",
                      "url",
                      "handle",
                      "sortOrder",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create social_links",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "platform": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "handle": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "social_links",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "platform": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "handle": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "platform",
                    "url",
                    "handle",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      }
    },
    "/content/social-links/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get social_links by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "social_links",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "platform": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "handle": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "platform",
                    "url",
                    "handle",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update social_links",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "platform": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "handle": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "social_links",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "platform": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "handle": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "platform",
                    "url",
                    "handle",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete social_links",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the org workspace that owns the rows; omit for the caller's own."
          }
        ]
      }
    },
    "/content/tags": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List tags",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "kind": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "label": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "level": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "sinceDate": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "notes": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "deletedAt",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "kind",
                      "label",
                      "level",
                      "sinceDate",
                      "notes",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create tags",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "level": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "sinceDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "tags",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "level": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "sinceDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "kind",
                    "label",
                    "level",
                    "sinceDate",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/tags/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get tags by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "tags",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "level": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "sinceDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "kind",
                    "label",
                    "level",
                    "sinceDate",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update tags",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "level": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "sinceDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "tags",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "level": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "sinceDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "notes": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "deletedAt",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "kind",
                    "label",
                    "level",
                    "sinceDate",
                    "notes",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete tags",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/urls": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "content"
        ],
        "summary": "List urls",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "originalUrl": {
                        "type": "string"
                      },
                      "canonicalUrl": {
                        "type": "string"
                      },
                      "canonicalUrlHash": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "title": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "note": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "previewStorageKey": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 500
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "previewUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "previewStatus": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "previewError": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "previewGeneratedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "previewAttempts": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "originalUrl",
                      "canonicalUrl",
                      "canonicalUrlHash",
                      "title",
                      "description",
                      "note",
                      "previewStorageKey",
                      "previewUrl",
                      "previewStatus",
                      "previewError",
                      "previewGeneratedAt",
                      "previewAttempts",
                      "createdAt",
                      "updatedAt",
                      "isDeleted",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "content"
        ],
        "summary": "Create urls",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "originalUrl": {
                    "type": "string"
                  },
                  "canonicalUrl": {
                    "type": "string"
                  },
                  "canonicalUrlHash": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "previewStorageKey": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "previewUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "previewStatus": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "previewError": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "previewGeneratedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "previewAttempts": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "originalUrl",
                  "canonicalUrl",
                  "canonicalUrlHash"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "urls",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "originalUrl": {
                      "type": "string"
                    },
                    "canonicalUrl": {
                      "type": "string"
                    },
                    "canonicalUrlHash": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewStorageKey": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "previewUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewStatus": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "previewError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewGeneratedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewAttempts": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "originalUrl",
                    "canonicalUrl",
                    "canonicalUrlHash",
                    "title",
                    "description",
                    "note",
                    "previewStorageKey",
                    "previewUrl",
                    "previewStatus",
                    "previewError",
                    "previewGeneratedAt",
                    "previewAttempts",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/urls/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Get urls by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "urls",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "originalUrl": {
                      "type": "string"
                    },
                    "canonicalUrl": {
                      "type": "string"
                    },
                    "canonicalUrlHash": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewStorageKey": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "previewUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewStatus": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "previewError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewGeneratedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewAttempts": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "originalUrl",
                    "canonicalUrl",
                    "canonicalUrlHash",
                    "title",
                    "description",
                    "note",
                    "previewStorageKey",
                    "previewUrl",
                    "previewStatus",
                    "previewError",
                    "previewGeneratedAt",
                    "previewAttempts",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "content"
        ],
        "summary": "Update urls",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "originalUrl": {
                    "type": "string"
                  },
                  "canonicalUrl": {
                    "type": "string"
                  },
                  "canonicalUrlHash": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "previewStorageKey": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "previewUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "previewStatus": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "previewError": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "previewGeneratedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "previewAttempts": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "urls",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "originalUrl": {
                      "type": "string"
                    },
                    "canonicalUrl": {
                      "type": "string"
                    },
                    "canonicalUrlHash": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewStorageKey": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "previewUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewStatus": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "previewError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewGeneratedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "previewAttempts": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "originalUrl",
                    "canonicalUrl",
                    "canonicalUrlHash",
                    "title",
                    "description",
                    "note",
                    "previewStorageKey",
                    "previewUrl",
                    "previewStatus",
                    "previewError",
                    "previewGeneratedAt",
                    "previewAttempts",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "content"
        ],
        "summary": "Delete urls",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/customers": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "customer"
        ],
        "summary": "List customers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "externalId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "email": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "displayName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "avatarUrl": {
                        "type": "string",
                        "maxLength": 1024
                      },
                      "publicProfileEnabled": {
                        "type": "boolean"
                      },
                      "profileVisibility": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "tokenVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "preferredMfaMethod": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "mfaFailedAttempts": {
                        "type": "integer",
                        "minimum": -32768,
                        "maximum": 32767
                      },
                      "mfaLockedUntil": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "externalId",
                      "email",
                      "displayName",
                      "slug",
                      "avatarUrl",
                      "publicProfileEnabled",
                      "profileVisibility",
                      "tokenVersion",
                      "preferredMfaMethod",
                      "mfaFailedAttempts",
                      "mfaLockedUntil",
                      "deletedAt",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "Create customers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "displayName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "avatarUrl": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "profileVisibility": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "preferredMfaMethod": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "slug"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "customers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "displayName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "avatarUrl": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "publicProfileEnabled": {
                      "type": "boolean"
                    },
                    "profileVisibility": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "tokenVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "preferredMfaMethod": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "mfaFailedAttempts": {
                      "type": "integer",
                      "minimum": -32768,
                      "maximum": 32767
                    },
                    "mfaLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "externalId",
                    "email",
                    "displayName",
                    "slug",
                    "avatarUrl",
                    "publicProfileEnabled",
                    "profileVisibility",
                    "tokenVersion",
                    "preferredMfaMethod",
                    "mfaFailedAttempts",
                    "mfaLockedUntil",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Besides the 403s every generated write can answer with, a caller who is not an operator may not create a hub account (\"hub accounts are created through registration or by an operator\") or give one an address reserved for operators (\"this email cannot be self-assigned\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customer/customers/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "customer"
        ],
        "summary": "Get customers by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "customers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "displayName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "avatarUrl": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "publicProfileEnabled": {
                      "type": "boolean"
                    },
                    "profileVisibility": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "tokenVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "preferredMfaMethod": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "mfaFailedAttempts": {
                      "type": "integer",
                      "minimum": -32768,
                      "maximum": 32767
                    },
                    "mfaLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "externalId",
                    "email",
                    "displayName",
                    "slug",
                    "avatarUrl",
                    "publicProfileEnabled",
                    "profileVisibility",
                    "tokenVersion",
                    "preferredMfaMethod",
                    "mfaFailedAttempts",
                    "mfaLockedUntil",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "customer"
        ],
        "summary": "Update customers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "displayName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "avatarUrl": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "profileVisibility": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "preferredMfaMethod": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "customers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "displayName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "avatarUrl": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "publicProfileEnabled": {
                      "type": "boolean"
                    },
                    "profileVisibility": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "tokenVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "preferredMfaMethod": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "mfaFailedAttempts": {
                      "type": "integer",
                      "minimum": -32768,
                      "maximum": 32767
                    },
                    "mfaLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "externalId",
                    "email",
                    "displayName",
                    "slug",
                    "avatarUrl",
                    "publicProfileEnabled",
                    "profileVisibility",
                    "tokenVersion",
                    "preferredMfaMethod",
                    "mfaFailedAttempts",
                    "mfaLockedUntil",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Besides the 403s every generated write can answer with, a caller who is not an operator may not give a hub account an address reserved for operators (\"this email cannot be self-assigned\") or change its handle, which changes only through PATCH /auth/me (\"a hub handle is changed through PATCH /auth/me\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "customer"
        ],
        "summary": "Delete customers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refused: this would leave no live operator (error.code = \"last_operator\"). Make someone else an operator first. Or: Refused: this still owns data (error.code = \"still_owns_data\", error.owned lists it by table). Hand it over (POST /ownership/handover) or erase it (POST /ownership/erase), then delete again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/blocks": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "document"
        ],
        "summary": "List blocks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "documentId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "position": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "blockType": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "contentText": {
                        "type": "string"
                      },
                      "contentMeta": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "lastOpId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "documentId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "position",
                      "blockType",
                      "contentText",
                      "contentMeta",
                      "createdAt",
                      "updatedAt",
                      "isDeleted",
                      "lastOpId",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Create blocks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "position": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "blockType": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "contentText": {
                    "type": "string"
                  },
                  "contentMeta": {
                    "type": "string"
                  },
                  "lastOpId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "documentId",
                  "position",
                  "blockType"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "blocks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "documentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "position": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "blockType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "contentText": {
                      "type": "string"
                    },
                    "contentMeta": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "lastOpId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "documentId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "position",
                    "blockType",
                    "contentText",
                    "contentMeta",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "lastOpId",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/blocks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Get blocks by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "blocks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "documentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "position": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "blockType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "contentText": {
                      "type": "string"
                    },
                    "contentMeta": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "lastOpId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "documentId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "position",
                    "blockType",
                    "contentText",
                    "contentMeta",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "lastOpId",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "document"
        ],
        "summary": "Update blocks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "position": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "blockType": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "contentText": {
                    "type": "string"
                  },
                  "contentMeta": {
                    "type": "string"
                  },
                  "lastOpId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "blocks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "documentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "position": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "blockType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "contentText": {
                      "type": "string"
                    },
                    "contentMeta": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "lastOpId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "documentId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "position",
                    "blockType",
                    "contentText",
                    "contentMeta",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "lastOpId",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "document"
        ],
        "summary": "Delete blocks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/documents": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "document"
        ],
        "summary": "List documents",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "docType": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "lastOpId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "lastSnapshotId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "title",
                      "docType",
                      "createdAt",
                      "updatedAt",
                      "isDeleted",
                      "lastOpId",
                      "lastSnapshotId",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Create documents",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "docType": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "lastOpId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastSnapshotId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "title"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "documents",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "docType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "lastOpId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastSnapshotId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "title",
                    "docType",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "lastOpId",
                    "lastSnapshotId",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/documents/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Get documents by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "documents",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "docType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "lastOpId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastSnapshotId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "title",
                    "docType",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "lastOpId",
                    "lastSnapshotId",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "document"
        ],
        "summary": "Update documents",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "docType": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "lastOpId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastSnapshotId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "documents",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "docType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "lastOpId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastSnapshotId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "title",
                    "docType",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "lastOpId",
                    "lastSnapshotId",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "document"
        ],
        "summary": "Delete documents",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/marks": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "document"
        ],
        "summary": "List marks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "blockId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "markType": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "startAnchor": {
                        "type": "string"
                      },
                      "endAnchor": {
                        "type": "string"
                      },
                      "markData": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "blockId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "markType",
                      "startAnchor",
                      "endAnchor",
                      "markData",
                      "createdAt",
                      "updatedAt",
                      "isDeleted",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Create marks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "blockId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "markType": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "startAnchor": {
                    "type": "string"
                  },
                  "endAnchor": {
                    "type": "string"
                  },
                  "markData": {
                    "type": "string"
                  }
                },
                "required": [
                  "blockId",
                  "markType",
                  "startAnchor",
                  "endAnchor"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "marks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "blockId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "markType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "startAnchor": {
                      "type": "string"
                    },
                    "endAnchor": {
                      "type": "string"
                    },
                    "markData": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "blockId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "markType",
                    "startAnchor",
                    "endAnchor",
                    "markData",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/marks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Get marks by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "marks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "blockId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "markType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "startAnchor": {
                      "type": "string"
                    },
                    "endAnchor": {
                      "type": "string"
                    },
                    "markData": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "blockId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "markType",
                    "startAnchor",
                    "endAnchor",
                    "markData",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "document"
        ],
        "summary": "Update marks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "blockId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "markType": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "startAnchor": {
                    "type": "string"
                  },
                  "endAnchor": {
                    "type": "string"
                  },
                  "markData": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "marks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "blockId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "markType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "startAnchor": {
                      "type": "string"
                    },
                    "endAnchor": {
                      "type": "string"
                    },
                    "markData": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "blockId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "markType",
                    "startAnchor",
                    "endAnchor",
                    "markData",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "document"
        ],
        "summary": "Delete marks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/operations": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "document"
        ],
        "summary": "List operations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "documentId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "blockId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "clientId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "clientSeq": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "opType": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "opPayload": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "undoGroupId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "inverseOfOpId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "documentId",
                      "blockId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "clientId",
                      "clientSeq",
                      "opType",
                      "opPayload",
                      "createdAt",
                      "undoGroupId",
                      "inverseOfOpId",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Create operations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "blockId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "clientId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "clientSeq": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "opType": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "opPayload": {
                    "type": "string"
                  },
                  "undoGroupId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "inverseOfOpId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "documentId",
                  "clientId",
                  "clientSeq",
                  "opType"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "operations",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "documentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "blockId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "clientId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "clientSeq": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "opType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "opPayload": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "undoGroupId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "inverseOfOpId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "documentId",
                    "blockId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "clientId",
                    "clientSeq",
                    "opType",
                    "opPayload",
                    "createdAt",
                    "undoGroupId",
                    "inverseOfOpId",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/operations/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Get operations by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "operations",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "documentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "blockId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "clientId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "clientSeq": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "opType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "opPayload": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "undoGroupId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "inverseOfOpId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "documentId",
                    "blockId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "clientId",
                    "clientSeq",
                    "opType",
                    "opPayload",
                    "createdAt",
                    "undoGroupId",
                    "inverseOfOpId",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "document"
        ],
        "summary": "Update operations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "blockId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "clientId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "clientSeq": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "opType": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "opPayload": {
                    "type": "string"
                  },
                  "undoGroupId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "inverseOfOpId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "operations",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "documentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "blockId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "clientId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "clientSeq": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "opType": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "opPayload": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "undoGroupId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "inverseOfOpId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "documentId",
                    "blockId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "clientId",
                    "clientSeq",
                    "opType",
                    "opPayload",
                    "createdAt",
                    "undoGroupId",
                    "inverseOfOpId",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "document"
        ],
        "summary": "Delete operations",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/versions": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "document"
        ],
        "summary": "List versions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "documentId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "description": {
                        "type": "string"
                      },
                      "pinnedOpId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "pinnedSyncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "documentId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "name",
                      "description",
                      "pinnedOpId",
                      "pinnedSyncVersion",
                      "createdAt",
                      "updatedAt",
                      "isDeleted",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Create versions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  },
                  "pinnedOpId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "pinnedSyncVersion": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "documentId",
                  "name",
                  "pinnedOpId",
                  "pinnedSyncVersion"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "versions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "documentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "pinnedOpId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "pinnedSyncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "documentId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "name",
                    "description",
                    "pinnedOpId",
                    "pinnedSyncVersion",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/versions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Get versions by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "versions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "documentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "pinnedOpId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "pinnedSyncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "documentId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "name",
                    "description",
                    "pinnedOpId",
                    "pinnedSyncVersion",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "document"
        ],
        "summary": "Update versions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  },
                  "pinnedOpId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "pinnedSyncVersion": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "versions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "documentId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "pinnedOpId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "pinnedSyncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "documentId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "name",
                    "description",
                    "pinnedOpId",
                    "pinnedSyncVersion",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "document"
        ],
        "summary": "Delete versions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/applications": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "List applications",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "ecosystemId": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "displayName": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "consumerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "platform": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "slug",
                      "displayName",
                      "consumerKind",
                      "platform",
                      "createdAt",
                      "updatedAt",
                      "isDeleted",
                      "deletedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Create applications",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "consumerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "platform": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "slug",
                  "displayName",
                  "consumerKind"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "applications",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "displayName": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "consumerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "platform": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "slug",
                    "displayName",
                    "consumerKind",
                    "platform",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/applications/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Get applications by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "applications",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "displayName": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "consumerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "platform": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "slug",
                    "displayName",
                    "consumerKind",
                    "platform",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Update applications",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "consumerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "platform": {
                    "type": "string",
                    "maxLength": 16
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "applications",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "displayName": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "consumerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "platform": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "slug",
                    "displayName",
                    "consumerKind",
                    "platform",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Delete applications",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refused: this still owns data (error.code = \"still_owns_data\", error.owned lists it by table). Hand it over (POST /ownership/handover) or erase it (POST /ownership/erase), then delete again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/ecosystem-regions": {
      "x-exposure": "admin",
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "List ecosystem_regions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "displayName": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "postgresHost": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "railwayServiceId": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "isDefaultForNewProjects": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "displayName",
                      "postgresHost",
                      "railwayServiceId",
                      "isDefaultForNewProjects",
                      "createdAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Create ecosystem_regions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "postgresHost": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "railwayServiceId": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "isDefaultForNewProjects": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "displayName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "ecosystem_regions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "displayName": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "postgresHost": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "railwayServiceId": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "isDefaultForNewProjects": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "displayName",
                    "postgresHost",
                    "railwayServiceId",
                    "isDefaultForNewProjects",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/ecosystem-regions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Get ecosystem_regions by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ecosystem_regions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "displayName": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "postgresHost": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "railwayServiceId": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "isDefaultForNewProjects": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "displayName",
                    "postgresHost",
                    "railwayServiceId",
                    "isDefaultForNewProjects",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Update ecosystem_regions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "postgresHost": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "railwayServiceId": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "isDefaultForNewProjects": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ecosystem_regions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "displayName": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "postgresHost": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "railwayServiceId": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "isDefaultForNewProjects": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "displayName",
                    "postgresHost",
                    "railwayServiceId",
                    "isDefaultForNewProjects",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Delete ecosystem_regions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ecosystem/ecosystems": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "List ecosystems",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "description": {
                        "type": "string"
                      },
                      "region": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "dedicatedDbConnectionId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 128
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "primaryDomain": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "isDefault": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "namespaceId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "parentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "archivedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "isInfrastructure": {
                        "type": "boolean",
                        "description": "Whether this is a principal's own ecosystem: true exactly when `type` is `workspace` or `persona`. Derived from `type`; read `type` instead."
                      },
                      "canManage": {
                        "type": "boolean",
                        "description": "Workspace mode only: whether the caller may manage this ecosystem. Absent otherwise.",
                        "x-list-annotation": true
                      }
                    },
                    "required": [
                      "id",
                      "ownerId",
                      "ownerKind",
                      "slug",
                      "name",
                      "description",
                      "region",
                      "dedicatedDbConnectionId",
                      "primaryDomain",
                      "createdAt",
                      "updatedAt",
                      "isDeleted",
                      "isDefault",
                      "type",
                      "namespaceId",
                      "parentId",
                      "archivedAt",
                      "isInfrastructure"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "parent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Rdid or uuid of a parent ecosystem the caller manages. Lists, or creates, its child ecosystems."
          },
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the workspace (the caller's own, or an org they belong to) whose owned ecosystems are listed or created. Empty is the same as absent. Ignored when `parent` is given."
          },
          {
            "name": "infrastructure",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Return only infrastructure ecosystems: with `workspace`, the workspace principal's own ecosystem; without it, the caller's own (at most one row). Ignored when `parent` is given."
          }
        ]
      },
      "post": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Create ecosystems",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "dedicatedDbConnectionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 128
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "primaryDomain": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "isDefault": {
                    "type": "boolean"
                  },
                  "namespaceId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "archivedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "slug",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "ecosystems",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "dedicatedDbConnectionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "primaryDomain": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "type": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "namespaceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isInfrastructure": {
                      "type": "boolean",
                      "description": "Whether this is a principal's own ecosystem: true exactly when `type` is `workspace` or `persona`. Derived from `type`; read `type` instead."
                    }
                  },
                  "required": [
                    "id",
                    "ownerId",
                    "ownerKind",
                    "slug",
                    "name",
                    "description",
                    "region",
                    "dedicatedDbConnectionId",
                    "primaryDomain",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "isDefault",
                    "type",
                    "namespaceId",
                    "parentId",
                    "archivedAt",
                    "isInfrastructure"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refused: an ecosystem with that id or slug already exists, or the `parent` is the Personal or Organization ecosystem, which cannot have sub-ecosystems.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "parent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Rdid or uuid of a parent ecosystem the caller manages. Lists, or creates, its child ecosystems."
          },
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug of the workspace (the caller's own, or an org they belong to) whose owned ecosystems are listed or created. Empty is the same as absent. Ignored when `parent` is given."
          }
        ]
      }
    },
    "/ecosystem/ecosystems/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Get ecosystems by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ecosystems",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "dedicatedDbConnectionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "primaryDomain": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "type": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "namespaceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isInfrastructure": {
                      "type": "boolean",
                      "description": "Whether this is a principal's own ecosystem: true exactly when `type` is `workspace` or `persona`. Derived from `type`; read `type` instead."
                    }
                  },
                  "required": [
                    "id",
                    "ownerId",
                    "ownerKind",
                    "slug",
                    "name",
                    "description",
                    "region",
                    "dedicatedDbConnectionId",
                    "primaryDomain",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "isDefault",
                    "type",
                    "namespaceId",
                    "parentId",
                    "archivedAt",
                    "isInfrastructure"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Update ecosystems",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "ownerKind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "dedicatedDbConnectionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 128
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "primaryDomain": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "isDefault": {
                    "type": "boolean"
                  },
                  "namespaceId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "archivedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ecosystems",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "dedicatedDbConnectionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "primaryDomain": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "type": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "namespaceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isInfrastructure": {
                      "type": "boolean",
                      "description": "Whether this is a principal's own ecosystem: true exactly when `type` is `workspace` or `persona`. Derived from `type`; read `type` instead."
                    }
                  },
                  "required": [
                    "id",
                    "ownerId",
                    "ownerKind",
                    "slug",
                    "name",
                    "description",
                    "region",
                    "dedicatedDbConnectionId",
                    "primaryDomain",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "isDefault",
                    "type",
                    "namespaceId",
                    "parentId",
                    "archivedAt",
                    "isInfrastructure"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refused: the slug is taken under this parent, or this is the Personal or Organization ecosystem, whose name and slug cannot be changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Delete ecosystems",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refused: an account infrastructure ecosystem, or the Personal or Organization ecosystem, cannot be deleted. Or: Refused: this still owns data (error.code = \"still_owns_data\", error.owned lists it by table). Hand it over (POST /ownership/handover) or erase it (POST /ownership/erase), then delete again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/definitions": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "game"
        ],
        "summary": "List definitions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "authorCustomerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "gameId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "kind": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "key": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "sortOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "data": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "authorCustomerId",
                      "gameId",
                      "kind",
                      "key",
                      "name",
                      "description",
                      "status",
                      "sortOrder",
                      "data",
                      "createdAt",
                      "updatedAt",
                      "deletedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Create definitions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "gameId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "key": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "data": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "gameId",
                  "kind",
                  "key",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "definitions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorCustomerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "data": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "authorCustomerId",
                    "gameId",
                    "kind",
                    "key",
                    "name",
                    "description",
                    "status",
                    "sortOrder",
                    "data",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/definitions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "game"
        ],
        "summary": "Get definitions by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "definitions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorCustomerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "data": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "authorCustomerId",
                    "gameId",
                    "kind",
                    "key",
                    "name",
                    "description",
                    "status",
                    "sortOrder",
                    "data",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "game"
        ],
        "summary": "Update definitions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "gameId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "key": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "data": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "definitions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorCustomerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "data": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "authorCustomerId",
                    "gameId",
                    "kind",
                    "key",
                    "name",
                    "description",
                    "status",
                    "sortOrder",
                    "data",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "game"
        ],
        "summary": "Delete definitions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/effects": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "game"
        ],
        "summary": "List effects",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "gameId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "definitionId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "key": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "trigger": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "target": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "operation": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "value": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "duration": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sortOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "gameId",
                      "definitionId",
                      "key",
                      "trigger",
                      "target",
                      "operation",
                      "value",
                      "duration",
                      "sortOrder",
                      "createdAt",
                      "updatedAt",
                      "deletedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Create effects",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "gameId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "definitionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "key": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "trigger": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "target": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "operation": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "value": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "duration": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "gameId",
                  "definitionId",
                  "key",
                  "trigger",
                  "target",
                  "operation",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "effects",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "definitionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "trigger": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "target": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "operation": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "value": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "duration": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "gameId",
                    "definitionId",
                    "key",
                    "trigger",
                    "target",
                    "operation",
                    "value",
                    "duration",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/effects/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "game"
        ],
        "summary": "Get effects by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "effects",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "definitionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "trigger": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "target": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "operation": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "value": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "duration": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "gameId",
                    "definitionId",
                    "key",
                    "trigger",
                    "target",
                    "operation",
                    "value",
                    "duration",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "game"
        ],
        "summary": "Update effects",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "gameId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "definitionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "key": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "trigger": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "target": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "operation": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "value": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "duration": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "effects",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "definitionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "key": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "trigger": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "target": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "operation": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "value": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "duration": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "gameId",
                    "definitionId",
                    "key",
                    "trigger",
                    "target",
                    "operation",
                    "value",
                    "duration",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "game"
        ],
        "summary": "Delete effects",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/games": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "game"
        ],
        "summary": "List games",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "engine": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "engineConfig": {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      "characterNames": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "eventLog": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "eventRetentionDays": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "slug",
                      "name",
                      "description",
                      "engine",
                      "engineConfig",
                      "characterNames",
                      "status",
                      "eventLog",
                      "eventRetentionDays",
                      "createdAt",
                      "updatedAt",
                      "deletedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Create games",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "engine": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "engineConfig": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "characterNames": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "eventLog": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "eventRetentionDays": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "slug",
                  "name",
                  "engine"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "games",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "engine": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "engineConfig": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "characterNames": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "eventLog": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "eventRetentionDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "slug",
                    "name",
                    "description",
                    "engine",
                    "engineConfig",
                    "characterNames",
                    "status",
                    "eventLog",
                    "eventRetentionDays",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/games/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "game"
        ],
        "summary": "Get games by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "games",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "engine": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "engineConfig": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "characterNames": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "eventLog": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "eventRetentionDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "slug",
                    "name",
                    "description",
                    "engine",
                    "engineConfig",
                    "characterNames",
                    "status",
                    "eventLog",
                    "eventRetentionDays",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "game"
        ],
        "summary": "Update games",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "engine": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "engineConfig": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "characterNames": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "eventLog": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "eventRetentionDays": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "games",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "engine": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "engineConfig": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "characterNames": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "eventLog": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "eventRetentionDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "slug",
                    "name",
                    "description",
                    "engine",
                    "engineConfig",
                    "characterNames",
                    "status",
                    "eventLog",
                    "eventRetentionDays",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "game"
        ],
        "summary": "Delete games",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/mappings": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "game"
        ],
        "summary": "List mappings",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "gameId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "fromId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "kind": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "toId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "amount": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "sortOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "gameId",
                      "fromId",
                      "kind",
                      "toId",
                      "amount",
                      "sortOrder",
                      "createdAt",
                      "updatedAt",
                      "deletedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Create mappings",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "gameId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "fromId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "toId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "amount": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "gameId",
                  "fromId",
                  "kind",
                  "toId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "mappings",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "fromId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "toId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "amount": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "gameId",
                    "fromId",
                    "kind",
                    "toId",
                    "amount",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/mappings/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "game"
        ],
        "summary": "Get mappings by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "mappings",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "fromId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "toId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "amount": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "gameId",
                    "fromId",
                    "kind",
                    "toId",
                    "amount",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "game"
        ],
        "summary": "Update mappings",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "gameId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "fromId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "toId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "amount": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "mappings",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "fromId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "toId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "amount": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "sortOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "gameId",
                    "fromId",
                    "kind",
                    "toId",
                    "amount",
                    "sortOrder",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "game"
        ],
        "summary": "Delete mappings",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/players": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "game"
        ],
        "summary": "List players",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "gameId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "characterName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 120
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "characterAvatarUrl": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1024
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "visibility": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "firstPlayedAt": {
                        "type": "string"
                      },
                      "lastPlayedAt": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "gameId",
                      "characterName",
                      "characterAvatarUrl",
                      "visibility",
                      "firstPlayedAt",
                      "lastPlayedAt",
                      "createdAt",
                      "updatedAt",
                      "deletedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Create players",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "gameId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "characterAvatarUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1024
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "visibility": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "firstPlayedAt": {
                    "type": "string"
                  },
                  "lastPlayedAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "gameId",
                  "firstPlayedAt",
                  "lastPlayedAt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "players",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "characterName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "characterAvatarUrl": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1024
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visibility": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "firstPlayedAt": {
                      "type": "string"
                    },
                    "lastPlayedAt": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "gameId",
                    "characterName",
                    "characterAvatarUrl",
                    "visibility",
                    "firstPlayedAt",
                    "lastPlayedAt",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/game/players/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "game"
        ],
        "summary": "Get players by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "players",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "characterName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "characterAvatarUrl": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1024
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visibility": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "firstPlayedAt": {
                      "type": "string"
                    },
                    "lastPlayedAt": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "gameId",
                    "characterName",
                    "characterAvatarUrl",
                    "visibility",
                    "firstPlayedAt",
                    "lastPlayedAt",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "game"
        ],
        "summary": "Update players",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "gameId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "characterAvatarUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1024
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "visibility": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "firstPlayedAt": {
                    "type": "string"
                  },
                  "lastPlayedAt": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "players",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "gameId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "characterName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "characterAvatarUrl": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1024
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visibility": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "firstPlayedAt": {
                      "type": "string"
                    },
                    "lastPlayedAt": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "gameId",
                    "characterName",
                    "characterAvatarUrl",
                    "visibility",
                    "firstPlayedAt",
                    "lastPlayedAt",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "game"
        ],
        "summary": "Delete players",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-audience-contacts": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "List integration_audience_contacts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "connectionId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "provider": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "audienceId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "externalId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "email": {
                        "type": "string",
                        "maxLength": 320
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "firstName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "lastName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tags": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "fields": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "subscribedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "raw": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "connectionId",
                      "provider",
                      "audienceId",
                      "externalId",
                      "email",
                      "status",
                      "firstName",
                      "lastName",
                      "tags",
                      "fields",
                      "subscribedAt",
                      "raw",
                      "isDeleted",
                      "deletedAt",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "integration"
        ],
        "summary": "Create integration_audience_contacts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "provider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "audienceId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 320
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "firstName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "lastName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tags": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fields": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subscribedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "raw": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "connectionId",
                  "provider",
                  "audienceId",
                  "externalId",
                  "email",
                  "status"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "integration_audience_contacts",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "provider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "audienceId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "email": {
                      "type": "string",
                      "maxLength": 320
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "firstName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tags": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fields": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subscribedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "raw": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "connectionId",
                    "provider",
                    "audienceId",
                    "externalId",
                    "email",
                    "status",
                    "firstName",
                    "lastName",
                    "tags",
                    "fields",
                    "subscribedAt",
                    "raw",
                    "isDeleted",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-audience-contacts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "Get integration_audience_contacts by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "integration_audience_contacts",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "provider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "audienceId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "email": {
                      "type": "string",
                      "maxLength": 320
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "firstName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tags": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fields": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subscribedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "raw": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "connectionId",
                    "provider",
                    "audienceId",
                    "externalId",
                    "email",
                    "status",
                    "firstName",
                    "lastName",
                    "tags",
                    "fields",
                    "subscribedAt",
                    "raw",
                    "isDeleted",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integration"
        ],
        "summary": "Update integration_audience_contacts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "provider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "audienceId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 320
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "firstName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "lastName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tags": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fields": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subscribedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "raw": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "integration_audience_contacts",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "provider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "audienceId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "email": {
                      "type": "string",
                      "maxLength": 320
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "firstName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tags": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fields": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subscribedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "raw": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "connectionId",
                    "provider",
                    "audienceId",
                    "externalId",
                    "email",
                    "status",
                    "firstName",
                    "lastName",
                    "tags",
                    "fields",
                    "subscribedAt",
                    "raw",
                    "isDeleted",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integration"
        ],
        "summary": "Delete integration_audience_contacts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-audiences": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "List integration_audiences",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "connectionId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "provider": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "externalId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "name": {
                        "type": "string"
                      },
                      "memberCount": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "raw": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "connectionId",
                      "provider",
                      "externalId",
                      "name",
                      "memberCount",
                      "raw",
                      "isDeleted",
                      "deletedAt",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "integration"
        ],
        "summary": "Create integration_audiences",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "provider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "name": {
                    "type": "string"
                  },
                  "memberCount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "raw": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "connectionId",
                  "provider",
                  "externalId",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "integration_audiences",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "provider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "name": {
                      "type": "string"
                    },
                    "memberCount": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "raw": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "connectionId",
                    "provider",
                    "externalId",
                    "name",
                    "memberCount",
                    "raw",
                    "isDeleted",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-audiences/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "Get integration_audiences by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "integration_audiences",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "provider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "name": {
                      "type": "string"
                    },
                    "memberCount": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "raw": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "connectionId",
                    "provider",
                    "externalId",
                    "name",
                    "memberCount",
                    "raw",
                    "isDeleted",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integration"
        ],
        "summary": "Update integration_audiences",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "provider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "name": {
                    "type": "string"
                  },
                  "memberCount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "raw": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "integration_audiences",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "provider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "name": {
                      "type": "string"
                    },
                    "memberCount": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "raw": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "connectionId",
                    "provider",
                    "externalId",
                    "name",
                    "memberCount",
                    "raw",
                    "isDeleted",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integration"
        ],
        "summary": "Delete integration_audiences",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-bookmarks": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "List integration_bookmarks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "connectionId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "externalId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "sourceProvider": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "url": {
                        "type": "string"
                      },
                      "excerpt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "note": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tags": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "imageUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "collectionId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "collectionName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "isFavorite": {
                        "type": "boolean"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "externalCreatedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "connectionId",
                      "externalId",
                      "sourceProvider",
                      "title",
                      "url",
                      "excerpt",
                      "note",
                      "tags",
                      "imageUrl",
                      "collectionId",
                      "collectionName",
                      "isFavorite",
                      "isDeleted",
                      "externalCreatedAt",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "integration"
        ],
        "summary": "Create integration_bookmarks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "sourceProvider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "url": {
                    "type": "string"
                  },
                  "excerpt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tags": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "imageUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "collectionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "collectionName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isFavorite": {
                    "type": "boolean"
                  },
                  "externalCreatedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "connectionId",
                  "externalId",
                  "sourceProvider",
                  "title",
                  "url"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "integration_bookmarks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "sourceProvider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "url": {
                      "type": "string"
                    },
                    "excerpt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tags": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "collectionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "collectionName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isFavorite": {
                      "type": "boolean"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "externalCreatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "sourceProvider",
                    "title",
                    "url",
                    "excerpt",
                    "note",
                    "tags",
                    "imageUrl",
                    "collectionId",
                    "collectionName",
                    "isFavorite",
                    "isDeleted",
                    "externalCreatedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-bookmarks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "Get integration_bookmarks by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "integration_bookmarks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "sourceProvider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "url": {
                      "type": "string"
                    },
                    "excerpt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tags": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "collectionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "collectionName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isFavorite": {
                      "type": "boolean"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "externalCreatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "sourceProvider",
                    "title",
                    "url",
                    "excerpt",
                    "note",
                    "tags",
                    "imageUrl",
                    "collectionId",
                    "collectionName",
                    "isFavorite",
                    "isDeleted",
                    "externalCreatedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integration"
        ],
        "summary": "Update integration_bookmarks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "sourceProvider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "url": {
                    "type": "string"
                  },
                  "excerpt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tags": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "imageUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "collectionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "collectionName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isFavorite": {
                    "type": "boolean"
                  },
                  "externalCreatedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "integration_bookmarks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "sourceProvider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "url": {
                      "type": "string"
                    },
                    "excerpt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tags": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "collectionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "collectionName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isFavorite": {
                      "type": "boolean"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "externalCreatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "sourceProvider",
                    "title",
                    "url",
                    "excerpt",
                    "note",
                    "tags",
                    "imageUrl",
                    "collectionId",
                    "collectionName",
                    "isFavorite",
                    "isDeleted",
                    "externalCreatedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integration"
        ],
        "summary": "Delete integration_bookmarks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-calendar-events": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "List integration_calendar_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "startTime": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "endTime": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "startDate": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 10
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "endDate": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 10
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "isAllDay": {
                        "type": "boolean"
                      },
                      "location": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "externalId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "connectionId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "calendarName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "calendarColor": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 20
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "organizer": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "attendees": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "reminders": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "url": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "aiExtraction": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "title",
                      "description",
                      "startTime",
                      "endTime",
                      "startDate",
                      "endDate",
                      "isAllDay",
                      "location",
                      "source",
                      "externalId",
                      "connectionId",
                      "calendarName",
                      "calendarColor",
                      "status",
                      "organizer",
                      "attendees",
                      "reminders",
                      "url",
                      "aiExtraction",
                      "createdAt",
                      "updatedAt",
                      "isDeleted",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "integration"
        ],
        "summary": "Create integration_calendar_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "startTime": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "endTime": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "startDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isAllDay": {
                    "type": "boolean"
                  },
                  "location": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "connectionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "calendarName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "calendarColor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "organizer": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "attendees": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "reminders": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "aiExtraction": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  }
                },
                "required": [
                  "title",
                  "source",
                  "externalId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "integration_calendar_events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startTime": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "endTime": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isAllDay": {
                      "type": "boolean"
                    },
                    "location": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "connectionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "calendarName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "calendarColor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "organizer": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "attendees": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reminders": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "aiExtraction": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "title",
                    "description",
                    "startTime",
                    "endTime",
                    "startDate",
                    "endDate",
                    "isAllDay",
                    "location",
                    "source",
                    "externalId",
                    "connectionId",
                    "calendarName",
                    "calendarColor",
                    "status",
                    "organizer",
                    "attendees",
                    "reminders",
                    "url",
                    "aiExtraction",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-calendar-events/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "Get integration_calendar_events by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "integration_calendar_events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startTime": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "endTime": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isAllDay": {
                      "type": "boolean"
                    },
                    "location": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "connectionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "calendarName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "calendarColor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "organizer": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "attendees": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reminders": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "aiExtraction": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "title",
                    "description",
                    "startTime",
                    "endTime",
                    "startDate",
                    "endDate",
                    "isAllDay",
                    "location",
                    "source",
                    "externalId",
                    "connectionId",
                    "calendarName",
                    "calendarColor",
                    "status",
                    "organizer",
                    "attendees",
                    "reminders",
                    "url",
                    "aiExtraction",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integration"
        ],
        "summary": "Update integration_calendar_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "startTime": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "endTime": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "startDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isAllDay": {
                    "type": "boolean"
                  },
                  "location": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "connectionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "calendarName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "calendarColor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "organizer": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "attendees": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "reminders": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "aiExtraction": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "integration_calendar_events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startTime": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "endTime": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isAllDay": {
                      "type": "boolean"
                    },
                    "location": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "connectionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "calendarName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "calendarColor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "organizer": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "attendees": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reminders": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "aiExtraction": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "title",
                    "description",
                    "startTime",
                    "endTime",
                    "startDate",
                    "endDate",
                    "isAllDay",
                    "location",
                    "source",
                    "externalId",
                    "connectionId",
                    "calendarName",
                    "calendarColor",
                    "status",
                    "organizer",
                    "attendees",
                    "reminders",
                    "url",
                    "aiExtraction",
                    "createdAt",
                    "updatedAt",
                    "isDeleted",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integration"
        ],
        "summary": "Delete integration_calendar_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-campaign-stats": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "List integration_campaign_stats",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "connectionId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "provider": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "audienceId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "externalId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "subject": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 32
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sentAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "recipients": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "opens": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "uniqueOpens": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "clicks": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "uniqueClicks": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "bounces": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "unsubscribes": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "raw": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ecosystemId",
                      "ownerKind",
                      "ownerId",
                      "connectionId",
                      "provider",
                      "audienceId",
                      "externalId",
                      "name",
                      "subject",
                      "status",
                      "sentAt",
                      "recipients",
                      "opens",
                      "uniqueOpens",
                      "clicks",
                      "uniqueClicks",
                      "bounces",
                      "unsubscribes",
                      "raw",
                      "isDeleted",
                      "deletedAt",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid",
                      "authorKind",
                      "authorId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "integration"
        ],
        "summary": "Create integration_campaign_stats",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "provider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "audienceId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "subject": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sentAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipients": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "opens": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "uniqueOpens": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clicks": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "uniqueClicks": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "bounces": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unsubscribes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "raw": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "connectionId",
                  "provider",
                  "audienceId",
                  "externalId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "integration_campaign_stats",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "provider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "audienceId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subject": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sentAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipients": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "opens": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "uniqueOpens": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "clicks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "uniqueClicks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "bounces": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unsubscribes": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "raw": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "connectionId",
                    "provider",
                    "audienceId",
                    "externalId",
                    "name",
                    "subject",
                    "status",
                    "sentAt",
                    "recipients",
                    "opens",
                    "uniqueOpens",
                    "clicks",
                    "uniqueClicks",
                    "bounces",
                    "unsubscribes",
                    "raw",
                    "isDeleted",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-campaign-stats/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "Get integration_campaign_stats by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "integration_campaign_stats",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "provider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "audienceId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subject": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sentAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipients": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "opens": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "uniqueOpens": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "clicks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "uniqueClicks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "bounces": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unsubscribes": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "raw": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "connectionId",
                    "provider",
                    "audienceId",
                    "externalId",
                    "name",
                    "subject",
                    "status",
                    "sentAt",
                    "recipients",
                    "opens",
                    "uniqueOpens",
                    "clicks",
                    "uniqueClicks",
                    "bounces",
                    "unsubscribes",
                    "raw",
                    "isDeleted",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integration"
        ],
        "summary": "Update integration_campaign_stats",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "provider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "audienceId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "subject": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sentAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipients": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "opens": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "uniqueOpens": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clicks": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "uniqueClicks": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "bounces": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unsubscribes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "raw": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "integration_campaign_stats",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "provider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "audienceId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subject": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sentAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipients": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "opens": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "uniqueOpens": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "clicks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "uniqueClicks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "bounces": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unsubscribes": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "raw": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ecosystemId",
                    "ownerKind",
                    "ownerId",
                    "connectionId",
                    "provider",
                    "audienceId",
                    "externalId",
                    "name",
                    "subject",
                    "status",
                    "sentAt",
                    "recipients",
                    "opens",
                    "uniqueOpens",
                    "clicks",
                    "uniqueClicks",
                    "bounces",
                    "unsubscribes",
                    "raw",
                    "isDeleted",
                    "deletedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid",
                    "authorKind",
                    "authorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integration"
        ],
        "summary": "Delete integration_campaign_stats",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-financial-transactions": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "List integration_financial_transactions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "connectionId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "externalId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "accountId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "accountName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "institutionName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "amount": {
                        "type": "string"
                      },
                      "currency": {
                        "type": "string",
                        "maxLength": 10
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "merchantName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "category": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "categoryDetailed": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "transactionDate": {
                        "type": "string",
                        "maxLength": 10
                      },
                      "authorizedDate": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 10
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "pending": {
                        "type": "boolean"
                      },
                      "logoUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "connectionId",
                      "externalId",
                      "accountId",
                      "accountName",
                      "institutionName",
                      "amount",
                      "currency",
                      "name",
                      "merchantName",
                      "category",
                      "categoryDetailed",
                      "transactionDate",
                      "authorizedDate",
                      "pending",
                      "logoUrl",
                      "isDeleted",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "integration"
        ],
        "summary": "Create integration_financial_transactions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "accountId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "accountName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "institutionName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string",
                    "maxLength": 10
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "merchantName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "category": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "categoryDetailed": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transactionDate": {
                    "type": "string",
                    "maxLength": 10
                  },
                  "authorizedDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "pending": {
                    "type": "boolean"
                  },
                  "logoUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "connectionId",
                  "externalId",
                  "accountId",
                  "amount",
                  "name",
                  "transactionDate"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "integration_financial_transactions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "accountId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "accountName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "institutionName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "amount": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string",
                      "maxLength": 10
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "merchantName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "category": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "categoryDetailed": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "transactionDate": {
                      "type": "string",
                      "maxLength": 10
                    },
                    "authorizedDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pending": {
                      "type": "boolean"
                    },
                    "logoUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "accountId",
                    "accountName",
                    "institutionName",
                    "amount",
                    "currency",
                    "name",
                    "merchantName",
                    "category",
                    "categoryDetailed",
                    "transactionDate",
                    "authorizedDate",
                    "pending",
                    "logoUrl",
                    "isDeleted",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-financial-transactions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "Get integration_financial_transactions by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "integration_financial_transactions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "accountId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "accountName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "institutionName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "amount": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string",
                      "maxLength": 10
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "merchantName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "category": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "categoryDetailed": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "transactionDate": {
                      "type": "string",
                      "maxLength": 10
                    },
                    "authorizedDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pending": {
                      "type": "boolean"
                    },
                    "logoUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "accountId",
                    "accountName",
                    "institutionName",
                    "amount",
                    "currency",
                    "name",
                    "merchantName",
                    "category",
                    "categoryDetailed",
                    "transactionDate",
                    "authorizedDate",
                    "pending",
                    "logoUrl",
                    "isDeleted",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integration"
        ],
        "summary": "Update integration_financial_transactions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "accountId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "accountName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "institutionName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string",
                    "maxLength": 10
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "merchantName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "category": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "categoryDetailed": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transactionDate": {
                    "type": "string",
                    "maxLength": 10
                  },
                  "authorizedDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "pending": {
                    "type": "boolean"
                  },
                  "logoUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "integration_financial_transactions",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "accountId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "accountName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "institutionName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "amount": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string",
                      "maxLength": 10
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "merchantName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "category": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "categoryDetailed": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "transactionDate": {
                      "type": "string",
                      "maxLength": 10
                    },
                    "authorizedDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pending": {
                      "type": "boolean"
                    },
                    "logoUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "accountId",
                    "accountName",
                    "institutionName",
                    "amount",
                    "currency",
                    "name",
                    "merchantName",
                    "category",
                    "categoryDetailed",
                    "transactionDate",
                    "authorizedDate",
                    "pending",
                    "logoUrl",
                    "isDeleted",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integration"
        ],
        "summary": "Delete integration_financial_transactions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-items": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "List integration_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "connectionId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "externalId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "itemType": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "body": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "state": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "repoFullName": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "repoUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "itemUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "number": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "labels": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "assignees": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "isRead": {
                        "type": "boolean"
                      },
                      "notificationReason": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 50
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "externalCreatedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "externalUpdatedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "connectionId",
                      "externalId",
                      "itemType",
                      "title",
                      "body",
                      "state",
                      "repoFullName",
                      "repoUrl",
                      "itemUrl",
                      "number",
                      "labels",
                      "assignees",
                      "isRead",
                      "notificationReason",
                      "isDeleted",
                      "externalCreatedAt",
                      "externalUpdatedAt",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "integration"
        ],
        "summary": "Create integration_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "itemType": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "body": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "repoFullName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "repoUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "itemUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "labels": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "assignees": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "isRead": {
                    "type": "boolean"
                  },
                  "notificationReason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 50
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalCreatedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "externalUpdatedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "connectionId",
                  "externalId",
                  "itemType",
                  "title",
                  "state",
                  "repoFullName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "integration_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "itemType": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "body": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "repoFullName": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "repoUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "itemUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "number": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "labels": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignees": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isRead": {
                      "type": "boolean"
                    },
                    "notificationReason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 50
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "externalCreatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUpdatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "itemType",
                    "title",
                    "body",
                    "state",
                    "repoFullName",
                    "repoUrl",
                    "itemUrl",
                    "number",
                    "labels",
                    "assignees",
                    "isRead",
                    "notificationReason",
                    "isDeleted",
                    "externalCreatedAt",
                    "externalUpdatedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-items/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "Get integration_items by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "integration_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "itemType": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "body": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "repoFullName": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "repoUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "itemUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "number": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "labels": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignees": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isRead": {
                      "type": "boolean"
                    },
                    "notificationReason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 50
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "externalCreatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUpdatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "itemType",
                    "title",
                    "body",
                    "state",
                    "repoFullName",
                    "repoUrl",
                    "itemUrl",
                    "number",
                    "labels",
                    "assignees",
                    "isRead",
                    "notificationReason",
                    "isDeleted",
                    "externalCreatedAt",
                    "externalUpdatedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integration"
        ],
        "summary": "Update integration_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "itemType": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "body": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "repoFullName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "repoUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "itemUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "labels": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "assignees": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "isRead": {
                    "type": "boolean"
                  },
                  "notificationReason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 50
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalCreatedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "externalUpdatedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "integration_items",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "itemType": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "body": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "repoFullName": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "repoUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "itemUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "number": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "labels": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignees": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isRead": {
                      "type": "boolean"
                    },
                    "notificationReason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 50
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "externalCreatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUpdatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "itemType",
                    "title",
                    "body",
                    "state",
                    "repoFullName",
                    "repoUrl",
                    "itemUrl",
                    "number",
                    "labels",
                    "assignees",
                    "isRead",
                    "notificationReason",
                    "isDeleted",
                    "externalCreatedAt",
                    "externalUpdatedAt",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integration"
        ],
        "summary": "Delete integration_items",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-pages": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "List integration_pages",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "connectionId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "externalId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "objectType": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "url": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "icon": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 10
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "parentType": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 20
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "parentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "isArchived": {
                        "type": "boolean"
                      },
                      "lastEditedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "connectionId",
                      "externalId",
                      "title",
                      "objectType",
                      "url",
                      "icon",
                      "parentType",
                      "parentId",
                      "isArchived",
                      "lastEditedAt",
                      "isDeleted",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "integration"
        ],
        "summary": "Create integration_pages",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "objectType": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "icon": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isArchived": {
                    "type": "boolean"
                  },
                  "lastEditedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "connectionId",
                  "externalId",
                  "objectType"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "integration_pages",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "objectType": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "icon": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentType": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isArchived": {
                      "type": "boolean"
                    },
                    "lastEditedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "title",
                    "objectType",
                    "url",
                    "icon",
                    "parentType",
                    "parentId",
                    "isArchived",
                    "lastEditedAt",
                    "isDeleted",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integration/integration-pages/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "integration"
        ],
        "summary": "Get integration_pages by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "integration_pages",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "objectType": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "icon": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentType": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isArchived": {
                      "type": "boolean"
                    },
                    "lastEditedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "title",
                    "objectType",
                    "url",
                    "icon",
                    "parentType",
                    "parentId",
                    "isArchived",
                    "lastEditedAt",
                    "isDeleted",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "integration"
        ],
        "summary": "Update integration_pages",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "objectType": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "icon": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isArchived": {
                    "type": "boolean"
                  },
                  "lastEditedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "integration_pages",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "objectType": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "icon": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentType": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isArchived": {
                      "type": "boolean"
                    },
                    "lastEditedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "title",
                    "objectType",
                    "url",
                    "icon",
                    "parentType",
                    "parentId",
                    "isArchived",
                    "lastEditedAt",
                    "isDeleted",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "integration"
        ],
        "summary": "Delete integration_pages",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/monitoring/endpoints": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "List endpoints",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "siteId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "userId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "kind": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "expectedStatus": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "expectedBodyContains": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "timeoutMs": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "degradedThresholdMs": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "checkIntervalSeconds": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "isActive": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "siteId",
                      "userId",
                      "authorKind",
                      "authorId",
                      "ownerKind",
                      "ownerId",
                      "kind",
                      "url",
                      "expectedStatus",
                      "expectedBodyContains",
                      "timeoutMs",
                      "degradedThresholdMs",
                      "checkIntervalSeconds",
                      "isActive",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "monitoring"
        ],
        "summary": "Create endpoints",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "siteId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "expectedStatus": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "expectedBodyContains": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "degradedThresholdMs": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "checkIntervalSeconds": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "isActive": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "siteId",
                  "url"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "siteId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 2048
                    },
                    "expectedStatus": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "expectedBodyContains": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timeoutMs": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "degradedThresholdMs": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "checkIntervalSeconds": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "siteId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "kind",
                    "url",
                    "expectedStatus",
                    "expectedBodyContains",
                    "timeoutMs",
                    "degradedThresholdMs",
                    "checkIntervalSeconds",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/monitoring/endpoints/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "Get endpoints by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "siteId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 2048
                    },
                    "expectedStatus": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "expectedBodyContains": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timeoutMs": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "degradedThresholdMs": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "checkIntervalSeconds": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "siteId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "kind",
                    "url",
                    "expectedStatus",
                    "expectedBodyContains",
                    "timeoutMs",
                    "degradedThresholdMs",
                    "checkIntervalSeconds",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "monitoring"
        ],
        "summary": "Update endpoints",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "siteId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "kind": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "expectedStatus": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "expectedBodyContains": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "degradedThresholdMs": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "checkIntervalSeconds": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "isActive": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "siteId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 2048
                    },
                    "expectedStatus": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "expectedBodyContains": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timeoutMs": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "degradedThresholdMs": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "checkIntervalSeconds": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "siteId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "kind",
                    "url",
                    "expectedStatus",
                    "expectedBodyContains",
                    "timeoutMs",
                    "degradedThresholdMs",
                    "checkIntervalSeconds",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "monitoring"
        ],
        "summary": "Delete endpoints",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/monitoring/health-checks": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "List health_checks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "endpointId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "userId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "responseTimeMs": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "statusCode": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "errorMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "checkedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "endpointId",
                      "userId",
                      "authorKind",
                      "authorId",
                      "ownerKind",
                      "ownerId",
                      "status",
                      "responseTimeMs",
                      "statusCode",
                      "errorMessage",
                      "checkedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "monitoring"
        ],
        "summary": "Create health_checks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "endpointId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "responseTimeMs": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "statusCode": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "errorMessage": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "checkedAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "endpointId",
                  "status",
                  "checkedAt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "health_checks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "endpointId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "responseTimeMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "statusCode": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "errorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "checkedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "endpointId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "status",
                    "responseTimeMs",
                    "statusCode",
                    "errorMessage",
                    "checkedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/monitoring/health-checks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "Get health_checks by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "health_checks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "endpointId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "responseTimeMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "statusCode": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "errorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "checkedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "endpointId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "status",
                    "responseTimeMs",
                    "statusCode",
                    "errorMessage",
                    "checkedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "monitoring"
        ],
        "summary": "Update health_checks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "endpointId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "responseTimeMs": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "statusCode": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "errorMessage": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "checkedAt": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "health_checks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "endpointId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "responseTimeMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "statusCode": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "errorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "checkedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "endpointId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "status",
                    "responseTimeMs",
                    "statusCode",
                    "errorMessage",
                    "checkedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "monitoring"
        ],
        "summary": "Delete health_checks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/monitoring/site-groups": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "List site_groups",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "userId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "retentionDays": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "displayOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "userId",
                      "authorKind",
                      "authorId",
                      "ownerKind",
                      "ownerId",
                      "name",
                      "slug",
                      "description",
                      "retentionDays",
                      "displayOrder",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "monitoring"
        ],
        "summary": "Create site_groups",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "retentionDays": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "displayOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "name",
                  "slug"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "site_groups",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "retentionDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "displayOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "name",
                    "slug",
                    "description",
                    "retentionDays",
                    "displayOrder",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/monitoring/site-groups/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "Get site_groups by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "site_groups",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "retentionDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "displayOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "name",
                    "slug",
                    "description",
                    "retentionDays",
                    "displayOrder",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "monitoring"
        ],
        "summary": "Update site_groups",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "retentionDays": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "displayOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "site_groups",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "retentionDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "displayOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "name",
                    "slug",
                    "description",
                    "retentionDays",
                    "displayOrder",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "monitoring"
        ],
        "summary": "Delete site_groups",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/monitoring/sites": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "List sites",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "siteGroupId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "userId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "displayOrder": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "siteGroupId",
                      "userId",
                      "authorKind",
                      "authorId",
                      "ownerKind",
                      "ownerId",
                      "name",
                      "slug",
                      "description",
                      "displayOrder",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "monitoring"
        ],
        "summary": "Create sites",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "siteGroupId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "displayOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "siteGroupId",
                  "name",
                  "slug"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "sites",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "siteGroupId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "siteGroupId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "name",
                    "slug",
                    "description",
                    "displayOrder",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/monitoring/sites/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "Get sites by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "sites",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "siteGroupId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "siteGroupId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "name",
                    "slug",
                    "description",
                    "displayOrder",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "monitoring"
        ],
        "summary": "Update sites",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "siteGroupId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "displayOrder": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "sites",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "siteGroupId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayOrder": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "siteGroupId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "name",
                    "slug",
                    "description",
                    "displayOrder",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "monitoring"
        ],
        "summary": "Delete sites",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/models": {
      "x-exposure": "catalog",
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "List models",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "templateId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "metadata": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "lastSyncedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "templateId",
                      "name",
                      "description",
                      "metadata",
                      "source",
                      "lastSyncedAt",
                      "createdAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Create models",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "templateId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "templateId",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "models",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "templateId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "lastSyncedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "templateId",
                    "name",
                    "description",
                    "metadata",
                    "source",
                    "lastSyncedAt",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/models/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "Get models by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "models",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "templateId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "lastSyncedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "templateId",
                    "name",
                    "description",
                    "metadata",
                    "source",
                    "lastSyncedAt",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "persona"
        ],
        "summary": "Update models",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "templateId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "models",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "templateId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "lastSyncedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "templateId",
                    "name",
                    "description",
                    "metadata",
                    "source",
                    "lastSyncedAt",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona"
        ],
        "summary": "Delete models",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/personas": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "List personas",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "userId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "description": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 500
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "visibility": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "model": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "serviceId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "appId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "avatarAttachmentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "modelPrompt": {
                        "type": "string"
                      },
                      "voice": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "character": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "examples": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "cannedChat": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "chatStatus": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean",
                                  "null"
                                ]
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "array",
                                "items": {}
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "ownedEcosystemId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "corpusEcosystemId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "userId",
                      "authorKind",
                      "authorId",
                      "ownerKind",
                      "ownerId",
                      "slug",
                      "name",
                      "description",
                      "visibility",
                      "model",
                      "serviceId",
                      "appId",
                      "avatarAttachmentId",
                      "modelPrompt",
                      "voice",
                      "character",
                      "examples",
                      "cannedChat",
                      "chatStatus",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Create personas",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "visibility": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "model": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "serviceId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "appId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "avatarAttachmentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "modelPrompt": {
                    "type": "string"
                  },
                  "voice": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "character": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "examples": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "cannedChat": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "chatStatus": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "slug",
                  "name",
                  "model",
                  "modelPrompt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "personas",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "userId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visibility": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "model": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "serviceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "appId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "avatarAttachmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "modelPrompt": {
                      "type": "string"
                    },
                    "voice": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "character": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "examples": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cannedChat": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "chatStatus": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "ownedEcosystemId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "corpusEcosystemId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "name",
                    "description",
                    "visibility",
                    "model",
                    "serviceId",
                    "appId",
                    "avatarAttachmentId",
                    "modelPrompt",
                    "voice",
                    "character",
                    "examples",
                    "cannedChat",
                    "chatStatus",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/personas/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "Get personas by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "personas",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "userId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visibility": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "model": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "serviceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "appId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "avatarAttachmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "modelPrompt": {
                      "type": "string"
                    },
                    "voice": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "character": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "examples": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cannedChat": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "chatStatus": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "ownedEcosystemId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "corpusEcosystemId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "name",
                    "description",
                    "visibility",
                    "model",
                    "serviceId",
                    "appId",
                    "avatarAttachmentId",
                    "modelPrompt",
                    "voice",
                    "character",
                    "examples",
                    "cannedChat",
                    "chatStatus",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "persona"
        ],
        "summary": "Update personas",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "visibility": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "model": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "serviceId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "appId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "avatarAttachmentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "modelPrompt": {
                    "type": "string"
                  },
                  "voice": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "character": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "examples": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "cannedChat": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "chatStatus": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "personas",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "userId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visibility": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "model": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "serviceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "appId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "avatarAttachmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "modelPrompt": {
                      "type": "string"
                    },
                    "voice": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "character": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "examples": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cannedChat": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "chatStatus": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": [
                                "string",
                                "number",
                                "boolean",
                                "null"
                              ]
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "ownedEcosystemId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "corpusEcosystemId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "name",
                    "description",
                    "visibility",
                    "model",
                    "serviceId",
                    "appId",
                    "avatarAttachmentId",
                    "modelPrompt",
                    "voice",
                    "character",
                    "examples",
                    "cannedChat",
                    "chatStatus",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona"
        ],
        "summary": "Delete personas",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refused: this still owns data (error.code = \"still_owns_data\", error.owned lists it by table). Hand it over (POST /ownership/handover) or erase it (POST /ownership/erase), then delete again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/special-interests": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "List special_interests",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "personaId": {
                        "type": "string"
                      },
                      "userId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "general": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "topical": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 120
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "specific": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 120
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "stances": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "bucketId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "position": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "bucketTypeId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "personaId",
                      "userId",
                      "authorKind",
                      "authorId",
                      "ownerKind",
                      "ownerId",
                      "slug",
                      "general",
                      "topical",
                      "specific",
                      "stances",
                      "bucketId",
                      "position",
                      "isDeleted",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Create special_interests",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "personaId": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "general": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "topical": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "specific": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "stances": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "position": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "personaId",
                  "slug",
                  "general"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "special_interests",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "personaId": {
                      "type": "string"
                    },
                    "userId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "general": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "topical": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "specific": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "stances": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bucketId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "bucketTypeId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "personaId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "general",
                    "topical",
                    "specific",
                    "stances",
                    "bucketId",
                    "position",
                    "isDeleted",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/special-interests/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "Get special_interests by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "special_interests",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "personaId": {
                      "type": "string"
                    },
                    "userId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "general": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "topical": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "specific": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "stances": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bucketId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "bucketTypeId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "personaId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "general",
                    "topical",
                    "specific",
                    "stances",
                    "bucketId",
                    "position",
                    "isDeleted",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "persona"
        ],
        "summary": "Update special_interests",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "personaId": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "general": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "topical": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "specific": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "stances": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "position": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "special_interests",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "personaId": {
                      "type": "string"
                    },
                    "userId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "general": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "topical": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "specific": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "stances": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bucketId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "bucketTypeId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "personaId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "general",
                    "topical",
                    "specific",
                    "stances",
                    "bucketId",
                    "position",
                    "isDeleted",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona"
        ],
        "summary": "Delete special_interests",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/tool-templates": {
      "x-exposure": "catalog",
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "List tool_templates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "toolKey": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "sourceKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "displayName": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 1024
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "toolKey",
                      "sourceKind",
                      "displayName",
                      "description",
                      "readOnly",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona"
        ],
        "summary": "Create tool_templates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "toolKey": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "sourceKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "readOnly": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "toolKey",
                  "sourceKind",
                  "displayName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "tool_templates",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "toolKey": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "sourceKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "displayName": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "readOnly": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "toolKey",
                    "sourceKind",
                    "displayName",
                    "description",
                    "readOnly",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona/tool-templates/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona"
        ],
        "summary": "Get tool_templates by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "tool_templates",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "toolKey": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "sourceKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "displayName": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "readOnly": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "toolKey",
                    "sourceKind",
                    "displayName",
                    "description",
                    "readOnly",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "persona"
        ],
        "summary": "Update tool_templates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "toolKey": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "sourceKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "readOnly": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "tool_templates",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "toolKey": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "sourceKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "displayName": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "readOnly": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "toolKey",
                    "sourceKind",
                    "displayName",
                    "description",
                    "readOnly",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona"
        ],
        "summary": "Delete tool_templates",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/blocks": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "persona_memory"
        ],
        "summary": "List blocks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "content": {
                        "anyOf": [
                          {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          },
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          {
                            "type": "array",
                            "items": {}
                          }
                        ]
                      },
                      "sizeLimit": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "name",
                      "content",
                      "sizeLimit",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Create blocks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "content": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "sizeLimit": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "content"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "blocks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "sizeLimit": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "content",
                    "sizeLimit",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/blocks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Get blocks by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "blocks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "sizeLimit": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "content",
                    "sizeLimit",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Update blocks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "content": {
                    "anyOf": [
                      {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "sizeLimit": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "blocks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "array",
                          "items": {}
                        }
                      ]
                    },
                    "sizeLimit": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "name",
                    "content",
                    "sizeLimit",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Delete blocks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/facts": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "persona_memory"
        ],
        "summary": "List facts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "personaId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "scope": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "memoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "subjectTable": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 100
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "subjectId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "predicate": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "objectTable": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 100
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "objectId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "objectValue": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "confidence": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "validFrom": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "validTo": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "supersedesId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "personaId",
                      "scope",
                      "memoryId",
                      "subjectTable",
                      "subjectId",
                      "predicate",
                      "objectTable",
                      "objectId",
                      "objectValue",
                      "source",
                      "confidence",
                      "validFrom",
                      "validTo",
                      "status",
                      "supersedesId",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Create facts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "personaId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "memoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subjectTable": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subjectId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "predicate": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "objectTable": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "objectId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "objectValue": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "confidence": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "validFrom": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "validTo": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "supersedesId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "personaId",
                  "predicate"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "facts",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "personaId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "memoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subjectTable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subjectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "predicate": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "objectTable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "objectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "objectValue": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "confidence": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "validFrom": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "validTo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "supersedesId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "personaId",
                    "scope",
                    "memoryId",
                    "subjectTable",
                    "subjectId",
                    "predicate",
                    "objectTable",
                    "objectId",
                    "objectValue",
                    "source",
                    "confidence",
                    "validFrom",
                    "validTo",
                    "status",
                    "supersedesId",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/facts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Get facts by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "facts",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "personaId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "memoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subjectTable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subjectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "predicate": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "objectTable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "objectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "objectValue": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "confidence": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "validFrom": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "validTo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "supersedesId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "personaId",
                    "scope",
                    "memoryId",
                    "subjectTable",
                    "subjectId",
                    "predicate",
                    "objectTable",
                    "objectId",
                    "objectValue",
                    "source",
                    "confidence",
                    "validFrom",
                    "validTo",
                    "status",
                    "supersedesId",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Update facts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "personaId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "memoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subjectTable": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subjectId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "predicate": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "objectTable": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "objectId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "objectValue": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "confidence": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "validFrom": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "validTo": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "supersedesId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "facts",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "personaId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "memoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subjectTable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subjectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "predicate": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "objectTable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "objectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "objectValue": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "confidence": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "validFrom": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "validTo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "supersedesId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "personaId",
                    "scope",
                    "memoryId",
                    "subjectTable",
                    "subjectId",
                    "predicate",
                    "objectTable",
                    "objectId",
                    "objectValue",
                    "source",
                    "confidence",
                    "validFrom",
                    "validTo",
                    "status",
                    "supersedesId",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Delete facts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/links": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "persona_memory"
        ],
        "summary": "List links",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "srcId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "dstId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "relation": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "srcId",
                      "dstId",
                      "relation",
                      "createdAt",
                      "updatedAt",
                      "deletedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Create links",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "srcId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "dstId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "relation": {
                    "type": "string",
                    "maxLength": 32
                  }
                },
                "required": [
                  "srcId",
                  "dstId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "links",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "srcId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "dstId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "relation": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "srcId",
                    "dstId",
                    "relation",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/links/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Get links by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "links",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "srcId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "dstId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "relation": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "srcId",
                    "dstId",
                    "relation",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Update links",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "srcId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "dstId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "relation": {
                    "type": "string",
                    "maxLength": 32
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "links",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "srcId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "dstId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "relation": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "srcId",
                    "dstId",
                    "relation",
                    "createdAt",
                    "updatedAt",
                    "deletedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Delete links",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/memories": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "persona_memory"
        ],
        "summary": "List memories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "personaId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "scope": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "memoryType": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "body": {
                        "type": "string"
                      },
                      "subjectTable": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 100
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "subjectId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "status": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "supersedesId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "confidence": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "validFrom": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "validTo": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "recallCount": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "lastRecalledAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "semanticEmbedding": {
                        "anyOf": [
                          {
                            "minItems": 256,
                            "maxItems": 256,
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "semanticStamp": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 96
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "semanticSource": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 32
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "personaId",
                      "scope",
                      "slug",
                      "memoryType",
                      "description",
                      "body",
                      "subjectTable",
                      "subjectId",
                      "status",
                      "supersedesId",
                      "source",
                      "confidence",
                      "tags",
                      "validFrom",
                      "validTo",
                      "recallCount",
                      "lastRecalledAt",
                      "semanticEmbedding",
                      "semanticStamp",
                      "semanticSource",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Create memories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "personaId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "memoryType": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "body": {
                    "type": "string"
                  },
                  "subjectTable": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subjectId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "supersedesId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "confidence": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "validFrom": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "validTo": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "personaId",
                  "slug",
                  "memoryType",
                  "description",
                  "body"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "memories",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "personaId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "memoryType": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "body": {
                      "type": "string"
                    },
                    "subjectTable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subjectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "supersedesId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "confidence": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "validFrom": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "validTo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recallCount": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "lastRecalledAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "semanticEmbedding": {
                      "anyOf": [
                        {
                          "minItems": 256,
                          "maxItems": 256,
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "semanticStamp": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 96
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "semanticSource": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "personaId",
                    "scope",
                    "slug",
                    "memoryType",
                    "description",
                    "body",
                    "subjectTable",
                    "subjectId",
                    "status",
                    "supersedesId",
                    "source",
                    "confidence",
                    "tags",
                    "validFrom",
                    "validTo",
                    "recallCount",
                    "lastRecalledAt",
                    "semanticEmbedding",
                    "semanticStamp",
                    "semanticSource",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/persona-memory/memories/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Get memories by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "memories",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "personaId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "memoryType": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "body": {
                      "type": "string"
                    },
                    "subjectTable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subjectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "supersedesId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "confidence": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "validFrom": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "validTo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recallCount": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "lastRecalledAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "semanticEmbedding": {
                      "anyOf": [
                        {
                          "minItems": 256,
                          "maxItems": 256,
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "semanticStamp": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 96
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "semanticSource": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "personaId",
                    "scope",
                    "slug",
                    "memoryType",
                    "description",
                    "body",
                    "subjectTable",
                    "subjectId",
                    "status",
                    "supersedesId",
                    "source",
                    "confidence",
                    "tags",
                    "validFrom",
                    "validTo",
                    "recallCount",
                    "lastRecalledAt",
                    "semanticEmbedding",
                    "semanticStamp",
                    "semanticSource",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Update memories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "personaId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "memoryType": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "body": {
                    "type": "string"
                  },
                  "subjectTable": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subjectId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "supersedesId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "confidence": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "validFrom": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "validTo": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "memories",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "personaId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "memoryType": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "body": {
                      "type": "string"
                    },
                    "subjectTable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subjectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "supersedesId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "confidence": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "validFrom": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "validTo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recallCount": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "lastRecalledAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "semanticEmbedding": {
                      "anyOf": [
                        {
                          "minItems": 256,
                          "maxItems": 256,
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "semanticStamp": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 96
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "semanticSource": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "personaId",
                    "scope",
                    "slug",
                    "memoryType",
                    "description",
                    "body",
                    "subjectTable",
                    "subjectId",
                    "status",
                    "supersedesId",
                    "source",
                    "confidence",
                    "tags",
                    "validFrom",
                    "validTo",
                    "recallCount",
                    "lastRecalledAt",
                    "semanticEmbedding",
                    "semanticStamp",
                    "semanticSource",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "persona_memory"
        ],
        "summary": "Delete memories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/personal/education": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "personal"
        ],
        "summary": "List education",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "institution": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "degree": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "fieldOfStudy": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "startDate": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "endDate": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 32
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "location": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "description": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "institution",
                      "degree",
                      "fieldOfStudy",
                      "startDate",
                      "endDate",
                      "location",
                      "description",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "personal"
        ],
        "summary": "Create education",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "institution": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "degree": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "fieldOfStudy": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "startDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "location": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "education",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "institution": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "degree": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "fieldOfStudy": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "startDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "location": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "institution",
                    "degree",
                    "fieldOfStudy",
                    "startDate",
                    "endDate",
                    "location",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/personal/education/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "personal"
        ],
        "summary": "Get education by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "education",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "institution": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "degree": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "fieldOfStudy": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "startDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "location": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "institution",
                    "degree",
                    "fieldOfStudy",
                    "startDate",
                    "endDate",
                    "location",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "personal"
        ],
        "summary": "Update education",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "institution": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "degree": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "fieldOfStudy": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "startDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "location": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "education",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "institution": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "degree": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "fieldOfStudy": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "startDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "location": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "institution",
                    "degree",
                    "fieldOfStudy",
                    "startDate",
                    "endDate",
                    "location",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "personal"
        ],
        "summary": "Delete education",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/personal/jobs": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "personal"
        ],
        "summary": "List jobs",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "company": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "role": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "startDate": {
                        "type": "string",
                        "maxLength": 32
                      },
                      "endDate": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 32
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "location": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "description": {
                        "type": "string"
                      },
                      "isCurrent": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "company",
                      "role",
                      "startDate",
                      "endDate",
                      "location",
                      "description",
                      "isCurrent",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "personal"
        ],
        "summary": "Create jobs",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "company": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "role": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "startDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "location": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  },
                  "isCurrent": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "jobs",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "company": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "role": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "startDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "location": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "isCurrent": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "company",
                    "role",
                    "startDate",
                    "endDate",
                    "location",
                    "description",
                    "isCurrent",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/personal/jobs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "personal"
        ],
        "summary": "Get jobs by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "jobs",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "company": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "role": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "startDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "location": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "isCurrent": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "company",
                    "role",
                    "startDate",
                    "endDate",
                    "location",
                    "description",
                    "isCurrent",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "personal"
        ],
        "summary": "Update jobs",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "company": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "role": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "startDate": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "location": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  },
                  "isCurrent": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "jobs",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "company": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "role": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "startDate": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "endDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "location": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "isCurrent": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "company",
                    "role",
                    "startDate",
                    "endDate",
                    "location",
                    "description",
                    "isCurrent",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "personal"
        ],
        "summary": "Delete jobs",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/tasks": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "project"
        ],
        "summary": "List tasks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "connectionId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "externalId": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "sourceProvider": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "isCompleted": {
                        "type": "boolean"
                      },
                      "priority": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "dueDate": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 10
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "dueDatetime": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "externalProjectId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "externalProjectName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "labels": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "url": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "connectionId",
                      "externalId",
                      "sourceProvider",
                      "title",
                      "description",
                      "isCompleted",
                      "priority",
                      "dueDate",
                      "dueDatetime",
                      "externalProjectId",
                      "externalProjectName",
                      "labels",
                      "url",
                      "isDeleted",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "project"
        ],
        "summary": "Create tasks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "sourceProvider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "isCompleted": {
                    "type": "boolean"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "dueDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dueDatetime": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "externalProjectId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalProjectName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "labels": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "connectionId",
                  "externalId",
                  "sourceProvider",
                  "title"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "tasks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "sourceProvider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isCompleted": {
                      "type": "boolean"
                    },
                    "priority": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "dueDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dueDatetime": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalProjectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "externalProjectName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "labels": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "sourceProvider",
                    "title",
                    "description",
                    "isCompleted",
                    "priority",
                    "dueDate",
                    "dueDatetime",
                    "externalProjectId",
                    "externalProjectName",
                    "labels",
                    "url",
                    "isDeleted",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/project/tasks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "project"
        ],
        "summary": "Get tasks by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "tasks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "sourceProvider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isCompleted": {
                      "type": "boolean"
                    },
                    "priority": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "dueDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dueDatetime": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalProjectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "externalProjectName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "labels": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "sourceProvider",
                    "title",
                    "description",
                    "isCompleted",
                    "priority",
                    "dueDate",
                    "dueDatetime",
                    "externalProjectId",
                    "externalProjectName",
                    "labels",
                    "url",
                    "isDeleted",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "project"
        ],
        "summary": "Update tasks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "connectionId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "externalId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "sourceProvider": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "isCompleted": {
                    "type": "boolean"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "dueDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dueDatetime": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "externalProjectId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalProjectName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "labels": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "tasks",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "connectionId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "sourceProvider": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isCompleted": {
                      "type": "boolean"
                    },
                    "priority": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "dueDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dueDatetime": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalProjectId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "externalProjectName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "labels": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "connectionId",
                    "externalId",
                    "sourceProvider",
                    "title",
                    "description",
                    "isCompleted",
                    "priority",
                    "dueDate",
                    "dueDatetime",
                    "externalProjectId",
                    "externalProjectName",
                    "labels",
                    "url",
                    "isDeleted",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "project"
        ],
        "summary": "Delete tasks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/settings/notifications": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "List notifications",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "customerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "email": {
                        "type": "boolean"
                      },
                      "sms": {
                        "type": "boolean"
                      },
                      "inApp": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "syncVersion": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "syncStampedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "syncTxid": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "customerId",
                      "ownerKind",
                      "ownerId",
                      "deletedAt",
                      "ecosystemId",
                      "category",
                      "email",
                      "sms",
                      "inApp",
                      "createdAt",
                      "updatedAt",
                      "syncVersion",
                      "syncStampedAt",
                      "syncTxid"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Create notifications",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "email": {
                    "type": "boolean"
                  },
                  "sms": {
                    "type": "boolean"
                  },
                  "inApp": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "category"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "notifications",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "email": {
                      "type": "boolean"
                    },
                    "sms": {
                      "type": "boolean"
                    },
                    "inApp": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "category",
                    "email",
                    "sms",
                    "inApp",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/settings/notifications/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Get notifications by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "notifications",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "email": {
                      "type": "boolean"
                    },
                    "sms": {
                      "type": "boolean"
                    },
                    "inApp": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "category",
                    "email",
                    "sms",
                    "inApp",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Update notifications",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "email": {
                    "type": "boolean"
                  },
                  "sms": {
                    "type": "boolean"
                  },
                  "inApp": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "notifications",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "customerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "email": {
                      "type": "boolean"
                    },
                    "sms": {
                      "type": "boolean"
                    },
                    "inApp": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "syncVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "syncStampedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "syncTxid": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "customerId",
                    "ownerKind",
                    "ownerId",
                    "deletedAt",
                    "ecosystemId",
                    "category",
                    "email",
                    "sms",
                    "inApp",
                    "createdAt",
                    "updatedAt",
                    "syncVersion",
                    "syncStampedAt",
                    "syncTxid"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "settings"
        ],
        "summary": "Delete notifications",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/groups": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "List groups",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "userId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "parentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "path": {
                        "type": "string"
                      },
                      "depth": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "position": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deletedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "userId",
                      "authorKind",
                      "authorId",
                      "ownerKind",
                      "ownerId",
                      "parentId",
                      "name",
                      "path",
                      "depth",
                      "position",
                      "createdAt",
                      "updatedAt",
                      "deletedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "shipr"
        ],
        "summary": "Create groups",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "path": {
                    "type": "string"
                  },
                  "depth": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "position": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "deletedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "groups",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "path": {
                      "type": "string"
                    },
                    "depth": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "parentId",
                    "name",
                    "path",
                    "depth",
                    "position",
                    "createdAt",
                    "updatedAt",
                    "deletedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/shipr/groups/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "shipr"
        ],
        "summary": "Get groups by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "groups",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "path": {
                      "type": "string"
                    },
                    "depth": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "parentId",
                    "name",
                    "path",
                    "depth",
                    "position",
                    "createdAt",
                    "updatedAt",
                    "deletedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "shipr"
        ],
        "summary": "Update groups",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "path": {
                    "type": "string"
                  },
                  "depth": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "position": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "deletedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "groups",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "userId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "path": {
                      "type": "string"
                    },
                    "depth": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "userId",
                    "authorKind",
                    "authorId",
                    "ownerKind",
                    "ownerId",
                    "parentId",
                    "name",
                    "path",
                    "depth",
                    "position",
                    "createdAt",
                    "updatedAt",
                    "deletedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "shipr"
        ],
        "summary": "Delete groups",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/audit-events": {
      "x-exposure": "admin",
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List audit_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ecosystemId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "developerId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "actorUserId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "eventType": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "payload": {
                        "type": "string"
                      },
                      "ipAddress": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "userAgent": {
                        "type": "string",
                        "maxLength": 512
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "ecosystemId",
                      "developerId",
                      "actorUserId",
                      "eventType",
                      "payload",
                      "ipAddress",
                      "userAgent",
                      "createdAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "system"
        ],
        "summary": "Create audit_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "developerId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actorUserId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "eventType": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "payload": {
                    "type": "string"
                  },
                  "ipAddress": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "userAgent": {
                    "type": "string",
                    "maxLength": 512
                  }
                },
                "required": [
                  "eventType"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "audit_events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "developerId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "actorUserId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "eventType": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "payload": {
                      "type": "string"
                    },
                    "ipAddress": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "userAgent": {
                      "type": "string",
                      "maxLength": 512
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "developerId",
                    "actorUserId",
                    "eventType",
                    "payload",
                    "ipAddress",
                    "userAgent",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/audit-events/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Get audit_events by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "audit_events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "developerId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "actorUserId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "eventType": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "payload": {
                      "type": "string"
                    },
                    "ipAddress": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "userAgent": {
                      "type": "string",
                      "maxLength": 512
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "developerId",
                    "actorUserId",
                    "eventType",
                    "payload",
                    "ipAddress",
                    "userAgent",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "system"
        ],
        "summary": "Update audit_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ecosystemId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "developerId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actorUserId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "eventType": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "payload": {
                    "type": "string"
                  },
                  "ipAddress": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "userAgent": {
                    "type": "string",
                    "maxLength": 512
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "audit_events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ecosystemId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "developerId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "actorUserId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "eventType": {
                      "type": "string",
                      "maxLength": 128
                    },
                    "payload": {
                      "type": "string"
                    },
                    "ipAddress": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "userAgent": {
                      "type": "string",
                      "maxLength": 512
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "ecosystemId",
                    "developerId",
                    "actorUserId",
                    "eventType",
                    "payload",
                    "ipAddress",
                    "userAgent",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "system"
        ],
        "summary": "Delete audit_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/team/teams": {
      "x-exposure": "owner",
      "get": {
        "tags": [
          "team"
        ],
        "summary": "List teams",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "ownerKind": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "ownerId": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "description": {
                        "type": "string"
                      },
                      "createdBy": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 16
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "authorId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "id",
                      "ownerKind",
                      "ownerId",
                      "slug",
                      "name",
                      "description",
                      "createdBy",
                      "authorKind",
                      "authorId",
                      "createdAt",
                      "updatedAt",
                      "isDeleted"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "team"
        ],
        "summary": "Create teams",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "required": [
                  "slug",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "teams",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "name",
                    "description",
                    "createdBy",
                    "authorKind",
                    "authorId",
                    "createdAt",
                    "updatedAt",
                    "isDeleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/team/teams/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "team"
        ],
        "summary": "Get teams by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "teams",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "name",
                    "description",
                    "createdBy",
                    "authorKind",
                    "authorId",
                    "createdAt",
                    "updatedAt",
                    "isDeleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "team"
        ],
        "summary": "Update teams",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ownerKind": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "ownerId": {
                    "type": "string",
                    "maxLength": 36
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "teams",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "ownerKind": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "ownerId": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "ownerKind",
                    "ownerId",
                    "slug",
                    "name",
                    "description",
                    "createdBy",
                    "authorKind",
                    "authorId",
                    "createdAt",
                    "updatedAt",
                    "isDeleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "team"
        ],
        "summary": "Delete teams",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/principal-tiers": {
      "x-exposure": "admin",
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "List principal_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "scope": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "principalId": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "tierId": {
                        "type": "string",
                        "maxLength": 36
                      }
                    },
                    "required": [
                      "scope",
                      "principalId",
                      "tierId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "usage"
        ],
        "summary": "Create principal_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "principalId": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "tierId": {
                    "type": "string",
                    "maxLength": 36
                  }
                },
                "required": [
                  "scope",
                  "principalId",
                  "tierId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "principal_tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "tierId": {
                      "type": "string",
                      "maxLength": 36
                    }
                  },
                  "required": [
                    "scope",
                    "principalId",
                    "tierId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/principal-tiers/{scope}/{principalId}": {
      "parameters": [
        {
          "name": "scope",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "principalId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Get principal_tiers by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "principal_tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "tierId": {
                      "type": "string",
                      "maxLength": 36
                    }
                  },
                  "required": [
                    "scope",
                    "principalId",
                    "tierId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "usage"
        ],
        "summary": "Update principal_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "principalId": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "tierId": {
                    "type": "string",
                    "maxLength": 36
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "principal_tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "tierId": {
                      "type": "string",
                      "maxLength": 36
                    }
                  },
                  "required": [
                    "scope",
                    "principalId",
                    "tierId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "usage"
        ],
        "summary": "Delete principal_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/rate-buckets": {
      "x-exposure": "admin",
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "List rate_buckets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "scope": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "principalId": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "tokensAvail": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "refilledAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "scope",
                      "principalId",
                      "tokensAvail",
                      "refilledAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "usage"
        ],
        "summary": "Create rate_buckets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "principalId": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "tokensAvail": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "refilledAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "scope",
                  "principalId",
                  "tokensAvail"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "rate_buckets",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "tokensAvail": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "refilledAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "scope",
                    "principalId",
                    "tokensAvail",
                    "refilledAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/rate-buckets/{scope}/{principalId}": {
      "parameters": [
        {
          "name": "scope",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "principalId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Get rate_buckets by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "rate_buckets",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "tokensAvail": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "refilledAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "scope",
                    "principalId",
                    "tokensAvail",
                    "refilledAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "usage"
        ],
        "summary": "Update rate_buckets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "principalId": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "tokensAvail": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "refilledAt": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "rate_buckets",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "tokensAvail": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "refilledAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "scope",
                    "principalId",
                    "tokensAvail",
                    "refilledAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "usage"
        ],
        "summary": "Delete rate_buckets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/rate-limit-tiers": {
      "x-exposure": "catalog",
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "List rate_limit_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 36
                      },
                      "slug": {
                        "type": "string",
                        "maxLength": 50
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "rateCapacity": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "rateRefillTokens": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "rateRefillSeconds": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "quotaRequests": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "quotaBytes": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "quotaTokens": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "quotaCostMicros": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "quotaPeriodDays": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "quotaEnforced": {
                        "type": "boolean"
                      },
                      "isDefault": {
                        "type": "boolean"
                      },
                      "isActive": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "slug",
                      "name",
                      "rateCapacity",
                      "rateRefillTokens",
                      "rateRefillSeconds",
                      "quotaRequests",
                      "quotaBytes",
                      "quotaTokens",
                      "quotaCostMicros",
                      "quotaPeriodDays",
                      "quotaEnforced",
                      "isDefault",
                      "isActive",
                      "createdAt",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "usage"
        ],
        "summary": "Create rate_limit_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "rateCapacity": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "rateRefillTokens": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "rateRefillSeconds": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "quotaRequests": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quotaBytes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quotaTokens": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quotaCostMicros": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quotaPeriodDays": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "quotaEnforced": {
                    "type": "boolean"
                  },
                  "isDefault": {
                    "type": "boolean"
                  },
                  "isActive": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "slug",
                  "name",
                  "rateCapacity",
                  "rateRefillTokens",
                  "rateRefillSeconds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "rate_limit_tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "rateCapacity": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "rateRefillTokens": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "rateRefillSeconds": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "quotaRequests": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaBytes": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaTokens": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaCostMicros": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaPeriodDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "quotaEnforced": {
                      "type": "boolean"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "rateCapacity",
                    "rateRefillTokens",
                    "rateRefillSeconds",
                    "quotaRequests",
                    "quotaBytes",
                    "quotaTokens",
                    "quotaCostMicros",
                    "quotaPeriodDays",
                    "quotaEnforced",
                    "isDefault",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/rate-limit-tiers/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Get rate_limit_tiers by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "rate_limit_tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "rateCapacity": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "rateRefillTokens": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "rateRefillSeconds": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "quotaRequests": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaBytes": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaTokens": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaCostMicros": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaPeriodDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "quotaEnforced": {
                      "type": "boolean"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "rateCapacity",
                    "rateRefillTokens",
                    "rateRefillSeconds",
                    "quotaRequests",
                    "quotaBytes",
                    "quotaTokens",
                    "quotaCostMicros",
                    "quotaPeriodDays",
                    "quotaEnforced",
                    "isDefault",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "usage"
        ],
        "summary": "Update rate_limit_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "rateCapacity": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "rateRefillTokens": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "rateRefillSeconds": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "quotaRequests": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quotaBytes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quotaTokens": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quotaCostMicros": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quotaPeriodDays": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "quotaEnforced": {
                    "type": "boolean"
                  },
                  "isDefault": {
                    "type": "boolean"
                  },
                  "isActive": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "rate_limit_tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36
                    },
                    "slug": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "rateCapacity": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "rateRefillTokens": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "rateRefillSeconds": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "quotaRequests": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaBytes": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaTokens": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaCostMicros": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotaPeriodDays": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "quotaEnforced": {
                      "type": "boolean"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "rateCapacity",
                    "rateRefillTokens",
                    "rateRefillSeconds",
                    "quotaRequests",
                    "quotaBytes",
                    "quotaTokens",
                    "quotaCostMicros",
                    "quotaPeriodDays",
                    "quotaEnforced",
                    "isDefault",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "usage"
        ],
        "summary": "Delete rate_limit_tiers",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/usage-counters": {
      "x-exposure": "admin",
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "List usage_counters",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "scope": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "principalId": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "periodStart": {
                        "type": "string"
                      },
                      "requests": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "bytes": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "tokens": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "costMicros": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "scope",
                      "principalId",
                      "periodStart",
                      "requests",
                      "bytes",
                      "tokens",
                      "costMicros",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "usage"
        ],
        "summary": "Create usage_counters",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "principalId": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "periodStart": {
                    "type": "string"
                  },
                  "requests": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "tokens": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "costMicros": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "scope",
                  "principalId",
                  "periodStart",
                  "requests",
                  "bytes"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "usage_counters",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "periodStart": {
                      "type": "string"
                    },
                    "requests": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "bytes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "tokens": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "costMicros": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "scope",
                    "principalId",
                    "periodStart",
                    "requests",
                    "bytes",
                    "tokens",
                    "costMicros",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/usage-counters/{scope}/{principalId}/{periodStart}": {
      "parameters": [
        {
          "name": "scope",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "principalId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "periodStart",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Get usage_counters by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "usage_counters",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "periodStart": {
                      "type": "string"
                    },
                    "requests": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "bytes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "tokens": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "costMicros": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "scope",
                    "principalId",
                    "periodStart",
                    "requests",
                    "bytes",
                    "tokens",
                    "costMicros",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "usage"
        ],
        "summary": "Update usage_counters",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "principalId": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "periodStart": {
                    "type": "string"
                  },
                  "requests": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "tokens": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "costMicros": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "usage_counters",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "periodStart": {
                      "type": "string"
                    },
                    "requests": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "bytes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "tokens": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "costMicros": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "scope",
                    "principalId",
                    "periodStart",
                    "requests",
                    "bytes",
                    "tokens",
                    "costMicros",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "usage"
        ],
        "summary": "Delete usage_counters",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/usage-events": {
      "x-exposure": "admin",
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "List usage_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "scope": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "principalId": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "ecosystemId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 36
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "route": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "method": {
                        "type": "string",
                        "maxLength": 8
                      },
                      "status": {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      "requestBytes": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "responseBytes": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "occurredAt": {
                        "type": "string"
                      },
                      "callId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "parentCallId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "kind": {
                        "type": "string"
                      },
                      "routePattern": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "durationMs": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "dbMs": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "dbQueries": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "streamEvents": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "scope",
                      "principalId",
                      "ecosystemId",
                      "route",
                      "method",
                      "status",
                      "requestBytes",
                      "responseBytes",
                      "occurredAt",
                      "callId",
                      "parentCallId",
                      "kind",
                      "routePattern",
                      "durationMs",
                      "dbMs",
                      "dbQueries",
                      "streamEvents"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "usage"
        ],
        "summary": "Create usage_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "principalId": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "ecosystemId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "route": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "method": {
                    "type": "string",
                    "maxLength": 8
                  },
                  "status": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "requestBytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "responseBytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "occurredAt": {
                    "type": "string"
                  },
                  "callId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentCallId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "kind": {
                    "type": "string"
                  },
                  "routePattern": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "durationMs": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dbMs": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dbQueries": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "streamEvents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "scope",
                  "principalId",
                  "route",
                  "method",
                  "status",
                  "requestBytes",
                  "responseBytes",
                  "occurredAt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "usage_events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "ecosystemId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "route": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "method": {
                      "type": "string",
                      "maxLength": 8
                    },
                    "status": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "requestBytes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "responseBytes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "occurredAt": {
                      "type": "string"
                    },
                    "callId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentCallId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "kind": {
                      "type": "string"
                    },
                    "routePattern": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "durationMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dbMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dbQueries": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "streamEvents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "scope",
                    "principalId",
                    "ecosystemId",
                    "route",
                    "method",
                    "status",
                    "requestBytes",
                    "responseBytes",
                    "occurredAt",
                    "callId",
                    "parentCallId",
                    "kind",
                    "routePattern",
                    "durationMs",
                    "dbMs",
                    "dbQueries",
                    "streamEvents"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage/usage-events/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Get usage_events by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "usage_events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "ecosystemId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "route": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "method": {
                      "type": "string",
                      "maxLength": 8
                    },
                    "status": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "requestBytes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "responseBytes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "occurredAt": {
                      "type": "string"
                    },
                    "callId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentCallId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "kind": {
                      "type": "string"
                    },
                    "routePattern": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "durationMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dbMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dbQueries": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "streamEvents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "scope",
                    "principalId",
                    "ecosystemId",
                    "route",
                    "method",
                    "status",
                    "requestBytes",
                    "responseBytes",
                    "occurredAt",
                    "callId",
                    "parentCallId",
                    "kind",
                    "routePattern",
                    "durationMs",
                    "dbMs",
                    "dbQueries",
                    "streamEvents"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "usage"
        ],
        "summary": "Update usage_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "maxLength": 16
                  },
                  "principalId": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "ecosystemId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "route": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "method": {
                    "type": "string",
                    "maxLength": 8
                  },
                  "status": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  },
                  "requestBytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "responseBytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "occurredAt": {
                    "type": "string"
                  },
                  "callId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentCallId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "kind": {
                    "type": "string"
                  },
                  "routePattern": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "durationMs": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dbMs": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dbQueries": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "streamEvents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -2147483648,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "usage_events",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "scope": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "principalId": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "ecosystemId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "route": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "method": {
                      "type": "string",
                      "maxLength": 8
                    },
                    "status": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "requestBytes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "responseBytes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "occurredAt": {
                      "type": "string"
                    },
                    "callId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parentCallId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "kind": {
                      "type": "string"
                    },
                    "routePattern": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "durationMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dbMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dbQueries": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "streamEvents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "scope",
                    "principalId",
                    "ecosystemId",
                    "route",
                    "method",
                    "status",
                    "requestBytes",
                    "responseBytes",
                    "occurredAt",
                    "callId",
                    "parentCallId",
                    "kind",
                    "routePattern",
                    "durationMs",
                    "dbMs",
                    "dbQueries",
                    "streamEvents"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "usage"
        ],
        "summary": "Delete usage_events",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
