{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "Context Layer Protocol",
    "version": "2026-12-01",
    "summary": "Normative schema for CLP (BIND-1).",
    "description": "Generated by spec/schema/build_schema.py. The prose specification governs; where they disagree this schema is defective (BIND-3). Error codes and their HTTP statuses are listed in `x-clp-error-codes` (BIND-7). Every operation names its governing rules (`x-clp-rules`), required permission (`x-clp-permission`), CLI command (`x-clp-cli`, BIND-17) and, where BIND-13 defines one, its MCP tool (`x-clp-mcp-tool`).",
    "license": {
      "name": "TBD",
      "identifier": "LicenseRef-TBD"
    }
  },
  "servers": [
    {
      "url": "{api_base_url}",
      "description": "`api_base_url` from the discovery document (BIND-4).",
      "variables": {
        "api_base_url": {
          "default": "https://api.second.example"
        }
      }
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {
      "dpop": []
    },
    {
      "oauth2": []
    }
  ],
  "tags": [
    {
      "name": "Identity",
      "description": "Module 1"
    },
    {
      "name": "Orgs",
      "description": "Module 2"
    },
    {
      "name": "Authorization",
      "description": "Module 3"
    },
    {
      "name": "Credentials",
      "description": "Module 4"
    },
    {
      "name": "OAuth",
      "description": "Module 4 — authorization server endpoints"
    },
    {
      "name": "Apps",
      "description": "Module 5"
    },
    {
      "name": "MCP servers",
      "description": "Module 5"
    },
    {
      "name": "Memory",
      "description": "Module 6"
    },
    {
      "name": "Spaces",
      "description": "Module 6"
    },
    {
      "name": "Events",
      "description": "Module 8"
    },
    {
      "name": "Operations",
      "description": "Module 0 (CORE-27)"
    },
    {
      "name": "Discovery",
      "description": "Module 9"
    },
    {
      "name": "Connectors",
      "description": "Module 10"
    }
  ],
  "paths": {
    "/principals": {
      "post": {
        "operationId": "createPrincipal",
        "summary": "Sign up (create a principal)",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupResult"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "security": [
          {},
          {
            "bearer": []
          },
          {
            "dpop": []
          }
        ],
        "x-clp-rules": [
          "ID-15",
          "ID-16",
          "ID-19",
          "ID-22",
          "ID-37"
        ],
        "x-clp-permission": "none (unauthenticated)",
        "x-clp-cli": "signup"
      }
    },
    "/me": {
      "get": {
        "operationId": "getMe",
        "summary": "The authenticated principal and its context",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-32"
        ],
        "x-clp-permission": "any authenticated principal",
        "x-clp-cli": "whoami",
        "x-clp-mcp-tool": "whoami"
      }
    },
    "/me/memberships": {
      "get": {
        "operationId": "listMyMemberships",
        "summary": "List the caller's memberships and invitations",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "invited",
                "active",
                "removed"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-5",
          "ORG-13"
        ],
        "x-clp-permission": "the principal",
        "x-clp-cli": "memberships list",
        "x-clp-mcp-tool": "list_memberships"
      }
    },
    "/me/email/verification": {
      "post": {
        "operationId": "requestEmailVerification",
        "summary": "Send an email verification code",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailVerificationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "No content",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-17"
        ],
        "x-clp-permission": "the principal",
        "x-clp-cli": "email send-code"
      }
    },
    "/me/email/verify": {
      "post": {
        "operationId": "verifyEmail",
        "summary": "Verify email with a one-time code",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailVerify"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Principal"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-17"
        ],
        "x-clp-permission": "the principal",
        "x-clp-cli": "email verify"
      }
    },
    "/principals/{principal_id}": {
      "get": {
        "operationId": "getPrincipal",
        "summary": "Get a principal",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/principal_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Principal"
                    },
                    {
                      "$ref": "#/components/schemas/PrincipalProfile"
                    }
                  ]
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-30",
          "ID-31",
          "CORE-16",
          "DISC-13"
        ],
        "x-clp-permission": "any authenticated principal (public profile); full object for self or controlling org",
        "x-clp-cli": "principals get"
      },
      "patch": {
        "operationId": "updatePrincipal",
        "summary": "Update a principal",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/principal_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrincipalUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Principal"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-21",
          "ORG-24"
        ],
        "x-clp-permission": "self; controlling org `principals:write`",
        "x-clp-cli": "principals update"
      },
      "delete": {
        "operationId": "deletePrincipal",
        "summary": "Delete a principal",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/principal_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Principal"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-33",
          "ID-34",
          "ID-35"
        ],
        "x-clp-permission": "self (if allowed); controlling org `principals:delete`",
        "x-clp-cli": "principals delete"
      }
    },
    "/principals/{principal_id}/claim-codes": {
      "post": {
        "operationId": "createClaimCode",
        "summary": "Generate a claim code",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/principal_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimCode"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-22",
          "ID-24",
          "ORG-20"
        ],
        "x-clp-permission": "self-controlled principal for itself; controlling org `principals:transfer`",
        "x-clp-cli": "principals claim-code"
      }
    },
    "/principals/{principal_id}/suspend": {
      "post": {
        "operationId": "suspendPrincipal",
        "summary": "Suspend a controlled principal",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/principal_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Principal"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-13",
          "ORG-24"
        ],
        "x-clp-permission": "controlling org `principals:suspend`",
        "x-clp-cli": "principals suspend"
      }
    },
    "/principals/{principal_id}/unsuspend": {
      "post": {
        "operationId": "unsuspendPrincipal",
        "summary": "Unsuspend a controlled principal",
        "tags": [
          "Identity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/principal_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Principal"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-24"
        ],
        "x-clp-permission": "controlling org `principals:suspend`",
        "x-clp-cli": "principals unsuspend"
      }
    },
    "/principals/{principal_id}/release": {
      "post": {
        "operationId": "releasePrincipal",
        "summary": "Release control of a principal",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/principal_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Principal"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-26",
          "ORG-21"
        ],
        "x-clp-permission": "controlling org `principals:release`",
        "x-clp-cli": "principals release"
      }
    },
    "/orgs": {
      "post": {
        "operationId": "createOrg",
        "summary": "Create an org",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrgCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Org"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-7"
        ],
        "x-clp-permission": "any established principal",
        "x-clp-cli": "orgs create"
      },
      "get": {
        "operationId": "listOrgs",
        "summary": "List orgs the caller belongs to",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-5"
        ],
        "x-clp-permission": "the principal",
        "x-clp-cli": "orgs list"
      }
    },
    "/orgs/{org_id}": {
      "get": {
        "operationId": "getOrg",
        "summary": "Get an org",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Org"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-4"
        ],
        "x-clp-permission": "`org:read`",
        "x-clp-cli": "orgs get"
      },
      "patch": {
        "operationId": "updateOrg",
        "summary": "Update an org or its policy",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrgUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Org"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-30",
          "ORG-32"
        ],
        "x-clp-permission": "`org:write`; `org:policy.write` for `policy`",
        "x-clp-cli": "orgs update"
      },
      "delete": {
        "operationId": "deleteOrg",
        "summary": "Delete an org",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          },
          {
            "name": "controlled_principals",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "release",
                "delete"
              ]
            },
            "description": "What happens to principals the org controls (ORG-39)."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Org"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-39",
          "ORG-40",
          "BIND-21"
        ],
        "x-clp-permission": "`owner` role",
        "x-clp-cli": "orgs delete"
      }
    },
    "/orgs/{org_id}/members": {
      "get": {
        "operationId": "listMembers",
        "summary": "List members",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "invited",
                "active",
                "removed"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-5"
        ],
        "x-clp-permission": "`members:read`",
        "x-clp-cli": "members list"
      }
    },
    "/orgs/{org_id}/members/{membership_id}": {
      "get": {
        "operationId": "getMember",
        "summary": "Get a membership",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/membership_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-5"
        ],
        "x-clp-permission": "`members:read`; the member",
        "x-clp-cli": "members get"
      },
      "patch": {
        "operationId": "updateMember",
        "summary": "Change a member's roles",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/membership_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-10",
          "ORG-14",
          "AUTH-9",
          "AUTH-10",
          "AUTH-11"
        ],
        "x-clp-permission": "`members:write`",
        "x-clp-cli": "members update"
      },
      "delete": {
        "operationId": "removeMember",
        "summary": "Remove a member, or leave",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/membership_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-9",
          "ORG-22",
          "ORG-27",
          "ORG-28"
        ],
        "x-clp-permission": "`members:remove`; the member itself to leave",
        "x-clp-cli": "members remove"
      }
    },
    "/orgs/{org_id}/invitations": {
      "post": {
        "operationId": "createInvitation",
        "summary": "Invite a principal",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-11",
          "ORG-12",
          "ORG-14",
          "ORG-15",
          "ORG-16"
        ],
        "x-clp-permission": "`members:invite`",
        "x-clp-cli": "members invite"
      },
      "get": {
        "operationId": "listInvitations",
        "summary": "List pending invitations",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-13"
        ],
        "x-clp-permission": "`members:read`",
        "x-clp-cli": "invitations list"
      }
    },
    "/orgs/{org_id}/invitations/{membership_id}/accept": {
      "post": {
        "operationId": "acceptInvitation",
        "summary": "Accept an invitation",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/membership_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-13"
        ],
        "x-clp-permission": "the invitee",
        "x-clp-cli": "invitations accept"
      }
    },
    "/orgs/{org_id}/invitations/{membership_id}/decline": {
      "post": {
        "operationId": "declineInvitation",
        "summary": "Decline an invitation",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/membership_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-13"
        ],
        "x-clp-permission": "the invitee",
        "x-clp-cli": "invitations decline"
      }
    },
    "/orgs/{org_id}/claims": {
      "post": {
        "operationId": "claimPrincipal",
        "summary": "Redeem a claim code for this org",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Principal"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-23",
          "ID-25",
          "ORG-17",
          "ORG-18"
        ],
        "x-clp-permission": "`principals:claim`; caller established",
        "x-clp-cli": "claim"
      }
    },
    "/orgs/{org_id}/principals": {
      "post": {
        "operationId": "createControlledPrincipal",
        "summary": "Create a principal controlled by the org",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlledPrincipalCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupResult"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ID-36",
          "ID-37",
          "ORG-19",
          "APP-17"
        ],
        "x-clp-permission": "`principals:create`",
        "x-clp-cli": "principals create"
      },
      "get": {
        "operationId": "listControlledPrincipals",
        "summary": "List principals the org controls",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrincipalList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "ORG-24"
        ],
        "x-clp-permission": "`members:read`",
        "x-clp-cli": "principals list"
      }
    },
    "/orgs/{org_id}/roles": {
      "get": {
        "operationId": "listRoles",
        "summary": "List roles (built-in and custom)",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-4",
          "AUTH-5"
        ],
        "x-clp-permission": "`roles:read`",
        "x-clp-cli": "roles list"
      },
      "post": {
        "operationId": "createRole",
        "summary": "Create a custom role",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-5",
          "AUTH-9"
        ],
        "x-clp-permission": "`roles:write`",
        "x-clp-cli": "roles create"
      }
    },
    "/orgs/{org_id}/roles/{role_id}": {
      "get": {
        "operationId": "getRole",
        "summary": "Get a role",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/role_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-4"
        ],
        "x-clp-permission": "`roles:read`",
        "x-clp-cli": "roles get"
      },
      "patch": {
        "operationId": "updateRole",
        "summary": "Update a custom role",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/role_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-5",
          "AUTH-9"
        ],
        "x-clp-permission": "`roles:write`",
        "x-clp-cli": "roles update"
      },
      "delete": {
        "operationId": "deleteRole",
        "summary": "Delete a custom role",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/org_id"
          },
          {
            "$ref": "#/components/parameters/role_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-5"
        ],
        "x-clp-permission": "`roles:write`",
        "x-clp-cli": "roles delete"
      }
    },
    "/grants": {
      "post": {
        "operationId": "createGrant",
        "summary": "Issue a grant",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GrantCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Grant"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-12",
          "AUTH-15",
          "AUTH-16",
          "AUTH-17"
        ],
        "x-clp-permission": "every granted permission on the resource, plus `spaces:share` for spaces",
        "x-clp-cli": "grants create",
        "x-clp-mcp-tool": "create_grant"
      },
      "get": {
        "operationId": "listGrants",
        "summary": "List grants issued over the caller's resources or received by it",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "issued",
                "received"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "active",
                "declined",
                "revoked",
                "expired"
              ]
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SpaceId"
                },
                {
                  "$ref": "#/components/schemas/OwnerId"
                },
                {
                  "$ref": "#/components/schemas/ConnectorId"
                },
                {
                  "$ref": "#/components/schemas/ConnectorViewId"
                }
              ]
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrantList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-14"
        ],
        "x-clp-permission": "owner of the resource, or grantee",
        "x-clp-cli": "grants list",
        "x-clp-mcp-tool": "list_grants"
      }
    },
    "/grants/{grant_id}": {
      "get": {
        "operationId": "getGrant",
        "summary": "Get a grant",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/grant_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Grant"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-12"
        ],
        "x-clp-permission": "owner side or grantee",
        "x-clp-cli": "grants get"
      }
    },
    "/grants/{grant_id}/accept": {
      "post": {
        "operationId": "acceptGrant",
        "summary": "Accept a grant",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/grant_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Grant"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-17"
        ],
        "x-clp-permission": "the grantee; for an org grantee `grants:accept`",
        "x-clp-cli": "grants accept",
        "x-clp-mcp-tool": "accept_grant"
      }
    },
    "/grants/{grant_id}/decline": {
      "post": {
        "operationId": "declineGrant",
        "summary": "Decline a grant",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/grant_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Grant"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-17"
        ],
        "x-clp-permission": "the grantee; for an org grantee `grants:accept`",
        "x-clp-cli": "grants decline",
        "x-clp-mcp-tool": "decline_grant"
      }
    },
    "/grants/{grant_id}/revoke": {
      "post": {
        "operationId": "revokeGrant",
        "summary": "Revoke a grant",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/grant_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Grant"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-17",
          "AUTH-23"
        ],
        "x-clp-permission": "any principal holding the granted permissions on the resource",
        "x-clp-cli": "grants revoke",
        "x-clp-mcp-tool": "revoke_grant"
      }
    },
    "/check": {
      "post": {
        "operationId": "check",
        "summary": "Ask whether the caller may perform an action",
        "tags": [
          "Authorization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckResult"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "AUTH-22"
        ],
        "x-clp-permission": "any authenticated principal (evaluates only itself)",
        "x-clp-cli": "check",
        "x-clp-mcp-tool": "check"
      }
    },
    "/credentials": {
      "get": {
        "operationId": "listCredentials",
        "summary": "List credentials",
        "tags": [
          "Credentials"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "holder_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PrincipalId"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "session",
                "api_key",
                "public_key"
              ]
            }
          },
          {
            "name": "app_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AppId"
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CRED-3",
          "CRED-18"
        ],
        "x-clp-permission": "holder; controlling org `principals:credentials`",
        "x-clp-cli": "keys list"
      },
      "post": {
        "operationId": "createCredential",
        "summary": "Create an API key or register a public key",
        "tags": [
          "Credentials"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialSecret"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CRED-1",
          "CRED-5",
          "CRED-6",
          "CRED-18",
          "CORE-34"
        ],
        "x-clp-permission": "holder; controlling org `principals:credentials`",
        "x-clp-cli": "keys create"
      }
    },
    "/credentials/{credential_id}": {
      "get": {
        "operationId": "getCredential",
        "summary": "Get a credential",
        "tags": [
          "Credentials"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/credential_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CRED-18"
        ],
        "x-clp-permission": "holder; controlling org `principals:credentials`",
        "x-clp-cli": "keys get"
      }
    },
    "/credentials/{credential_id}/rotate": {
      "post": {
        "operationId": "rotateCredential",
        "summary": "Rotate an API key",
        "tags": [
          "Credentials"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/credential_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialRotate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialSecret"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CRED-19"
        ],
        "x-clp-permission": "holder; controlling org `principals:credentials`",
        "x-clp-cli": "keys rotate"
      }
    },
    "/credentials/{credential_id}/revoke": {
      "post": {
        "operationId": "revokeCredential",
        "summary": "Revoke a credential",
        "tags": [
          "Credentials"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/credential_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CRED-18",
          "AUTH-23"
        ],
        "x-clp-permission": "holder; controlling org `principals:credentials`",
        "x-clp-cli": "keys revoke"
      }
    },
    "/oauth/authorize": {
      "get": {
        "operationId": "authorize",
        "summary": "OAuth 2.1 authorization endpoint",
        "description": "Redirects to the client's `redirect_uri`. PKCE (S256) is required (APP-2).",
        "tags": [
          "OAuth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "name": "response_type",
            "in": "query",
            "required": false,
            "schema": {
              "const": "code"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AppId"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": false,
            "schema": {
              "const": "S256"
            }
          },
          {
            "name": "nonce",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "No content",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          },
          "400": {
            "description": "RFC 6749 error (CORE-35).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "RFC 6749 error (CORE-35).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        },
        "security": [],
        "x-clp-rules": [
          "CRED-9",
          "APP-2",
          "APP-9"
        ],
        "x-clp-permission": "browser user agent"
      }
    },
    "/oauth/token": {
      "post": {
        "operationId": "token",
        "summary": "OAuth 2.1 token endpoint",
        "tags": [
          "OAuth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          },
          "400": {
            "description": "RFC 6749 error (CORE-35).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "RFC 6749 error (CORE-35).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        },
        "security": [],
        "x-clp-rules": [
          "CRED-9",
          "CRED-11",
          "CRED-12",
          "CRED-13",
          "CRED-14",
          "CRED-15",
          "CRED-16",
          "APP-25",
          "CORE-35",
          "BIND-22"
        ],
        "x-clp-permission": "client authentication as applicable"
      }
    },
    "/oauth/device": {
      "post": {
        "operationId": "deviceAuthorization",
        "summary": "Device authorization (RFC 8628)",
        "tags": [
          "OAuth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceAuthorizationResponse"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          },
          "400": {
            "description": "RFC 6749 error (CORE-35).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "RFC 6749 error (CORE-35).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        },
        "security": [],
        "x-clp-rules": [
          "CRED-9"
        ],
        "x-clp-permission": "none",
        "x-clp-cli": "login"
      }
    },
    "/oauth/email-otp": {
      "post": {
        "operationId": "requestEmailOtp",
        "summary": "Request an email one-time sign-in code",
        "description": "Step one of `urn:clp:grant-type:email-otp`; the code is exchanged at /oauth/token.",
        "tags": [
          "OAuth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "client_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "No content",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          },
          "400": {
            "description": "RFC 6749 error (CORE-35).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "RFC 6749 error (CORE-35).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        },
        "security": [],
        "x-clp-rules": [
          "ID-18",
          "CRED-9"
        ],
        "x-clp-permission": "none"
      }
    },
    "/apps": {
      "post": {
        "operationId": "createApp",
        "summary": "Register an app",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSecrets"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-1",
          "APP-2",
          "APP-4",
          "APP-5"
        ],
        "x-clp-permission": "`apps:write`",
        "x-clp-cli": "apps create"
      },
      "get": {
        "operationId": "listApps",
        "summary": "List apps owned by an org",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "owner_org_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrgId"
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-4"
        ],
        "x-clp-permission": "`apps:read`",
        "x-clp-cli": "apps list"
      }
    },
    "/apps/{app_id}": {
      "get": {
        "operationId": "getApp",
        "summary": "Get an app",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/app_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-1"
        ],
        "x-clp-permission": "any authenticated principal (public fields)",
        "x-clp-cli": "apps get"
      },
      "patch": {
        "operationId": "updateApp",
        "summary": "Update an app",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/app_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-2",
          "APP-28"
        ],
        "x-clp-permission": "`apps:write`",
        "x-clp-cli": "apps update"
      },
      "delete": {
        "operationId": "deleteApp",
        "summary": "Delete an app",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/app_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-4"
        ],
        "x-clp-permission": "`apps:write`",
        "x-clp-cli": "apps delete"
      }
    },
    "/apps/{app_id}/installations": {
      "post": {
        "operationId": "installApp",
        "summary": "Install an app into an org",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/app_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Installation"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-23",
          "APP-24",
          "APP-25",
          "APP-26"
        ],
        "x-clp-permission": "`apps:install`",
        "x-clp-cli": "apps install"
      },
      "get": {
        "operationId": "listInstallations",
        "summary": "List installations",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/app_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "org_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrgId"
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-23"
        ],
        "x-clp-permission": "`apps:read` in the installing org; the app's owning org",
        "x-clp-cli": "installations list"
      }
    },
    "/apps/{app_id}/installations/{installation_id}": {
      "delete": {
        "operationId": "uninstallApp",
        "summary": "Uninstall an app",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/app_id"
          },
          {
            "$ref": "#/components/parameters/installation_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Installation"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-27",
          "APP-28"
        ],
        "x-clp-permission": "`apps:install`",
        "x-clp-cli": "apps uninstall"
      }
    },
    "/connections": {
      "get": {
        "operationId": "listConnections",
        "summary": "List app connections (credentials with an app_id)",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "holder_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PrincipalId"
            }
          },
          {
            "name": "app_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AppId"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "revoked",
                "expired",
                "pending_approval"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-11",
          "APP-15"
        ],
        "x-clp-permission": "holder; controlling org `principals:credentials`; `apps:approve` for pending",
        "x-clp-cli": "connections list"
      }
    },
    "/connections/{credential_id}": {
      "get": {
        "operationId": "getConnection",
        "summary": "Get an app connection",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/credential_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-11"
        ],
        "x-clp-permission": "holder; controlling org `principals:credentials`",
        "x-clp-cli": "connections get"
      },
      "patch": {
        "operationId": "updateConnection",
        "summary": "Reduce an app connection's access",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/credential_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-15",
          "AUTH-23"
        ],
        "x-clp-permission": "holder; controlling org `principals:credentials`",
        "x-clp-cli": "connections update"
      }
    },
    "/connections/{credential_id}/approve": {
      "post": {
        "operationId": "approveConnection",
        "summary": "Approve a pending connection",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/credential_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-14"
        ],
        "x-clp-permission": "`apps:approve` in the acting org",
        "x-clp-cli": "connections approve"
      }
    },
    "/connections/{credential_id}/revoke": {
      "post": {
        "operationId": "revokeConnection",
        "summary": "Revoke an app connection",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/credential_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-15",
          "APP-28"
        ],
        "x-clp-permission": "holder; controlling org `principals:credentials`",
        "x-clp-cli": "connections revoke"
      }
    },
    "/mcp-servers": {
      "post": {
        "operationId": "createMcpServer",
        "summary": "Create an MCP server",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpServerCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerSecret"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-29",
          "APP-30",
          "APP-31",
          "APP-32",
          "APP-33"
        ],
        "x-clp-permission": "principal owner; `mcp:write` for org-owned",
        "x-clp-cli": "mcp create"
      },
      "get": {
        "operationId": "listMcpServers",
        "summary": "List MCP servers",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "owner_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OwnerId"
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-29"
        ],
        "x-clp-permission": "owner; `mcp:read` for org-owned",
        "x-clp-cli": "mcp list"
      }
    },
    "/mcp-servers/{mcp_id}": {
      "get": {
        "operationId": "getMcpServer",
        "summary": "Get an MCP server",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/mcp_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServer"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-29"
        ],
        "x-clp-permission": "owner; `mcp:read`",
        "x-clp-cli": "mcp get"
      },
      "patch": {
        "operationId": "updateMcpServer",
        "summary": "Update an MCP server",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/mcp_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpServerUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServer"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-29",
          "APP-31"
        ],
        "x-clp-permission": "owner; `mcp:write`",
        "x-clp-cli": "mcp update"
      },
      "delete": {
        "operationId": "deleteMcpServer",
        "summary": "Delete an MCP server",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/mcp_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServer"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "APP-30",
          "APP-31"
        ],
        "x-clp-permission": "owner; `mcp:write`",
        "x-clp-cli": "mcp delete"
      }
    },
    "/memories/{owner_id}/records": {
      "post": {
        "operationId": "rememberInMemory",
        "summary": "Remember records in a memory",
        "tags": [
          "Memory"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RememberRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-3",
          "MEM-5",
          "MEM-6",
          "MEM-16",
          "MEM-17",
          "APP-19"
        ],
        "x-clp-permission": "`memory:write` on the memory or a space grant",
        "x-clp-cli": "records create"
      },
      "get": {
        "operationId": "listRecords",
        "summary": "List records",
        "tags": [
          "Memory"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "space_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SpaceId"
            }
          },
          {
            "name": "author_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PrincipalId"
            }
          },
          {
            "name": "app_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AppId"
            }
          },
          {
            "name": "source_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "occurred_after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
            }
          },
          {
            "name": "occurred_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
            }
          },
          {
            "name": "visibility",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "normal",
                "private"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-15",
          "MEM-17"
        ],
        "x-clp-permission": "`memory:read`",
        "x-clp-cli": "records list",
        "x-clp-mcp-tool": "list_records"
      }
    },
    "/memories/{owner_id}/records/{record_id}": {
      "get": {
        "operationId": "getRecord",
        "summary": "Get a record",
        "tags": [
          "Memory"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/record_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-15",
          "MEM-17"
        ],
        "x-clp-permission": "`memory:read`",
        "x-clp-cli": "records get",
        "x-clp-mcp-tool": "get_record"
      },
      "patch": {
        "operationId": "updateRecord",
        "summary": "Update a record's labels, visibility, expiry or metadata",
        "tags": [
          "Memory"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/record_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-5"
        ],
        "x-clp-permission": "`memory:write`; `spaces:write` to change labels",
        "x-clp-cli": "records update",
        "x-clp-mcp-tool": "update_record"
      }
    },
    "/remember": {
      "post": {
        "operationId": "remember",
        "summary": "Remember records in the default or named target",
        "tags": [
          "Memory"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RememberAnyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-19",
          "MEM-20"
        ],
        "x-clp-permission": "`memory:write` on the target",
        "x-clp-cli": "remember",
        "x-clp-mcp-tool": "remember"
      }
    },
    "/recall": {
      "post": {
        "operationId": "recall",
        "summary": "Recall memory relevant to a query",
        "tags": [
          "Memory"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecallRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecallResult"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-23",
          "MEM-24",
          "MEM-25",
          "MEM-26",
          "MEM-27",
          "EVT-9",
          "EVT-10"
        ],
        "x-clp-permission": "`memory:read` on each target",
        "x-clp-cli": "recall",
        "x-clp-mcp-tool": "recall"
      }
    },
    "/forget": {
      "post": {
        "operationId": "forget",
        "summary": "Forget records permanently",
        "tags": [
          "Memory"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgetResult"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-21",
          "MEM-33",
          "APP-20",
          "BIND-21"
        ],
        "x-clp-permission": "`memory:forget`",
        "x-clp-cli": "forget",
        "x-clp-mcp-tool": "forget"
      }
    },
    "/memories/{owner_id}/export": {
      "post": {
        "operationId": "exportMemory",
        "summary": "Export a memory",
        "tags": [
          "Memory"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-29",
          "MEM-31"
        ],
        "x-clp-permission": "owner; `memory:read` + `memory:read.private` in the owning org; controlling org `principals:memory`",
        "x-clp-cli": "memory export"
      }
    },
    "/memories/{owner_id}/import": {
      "post": {
        "operationId": "importMemory",
        "summary": "Import a JSON Lines bundle",
        "tags": [
          "Memory"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/jsonl": {
              "schema": {
                "$ref": "#/components/schemas/ExportLine",
                "description": "JSON Lines: one ExportLine per line (MEM-30)."
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-30"
        ],
        "x-clp-permission": "owner; `memory:write` in the owning org",
        "x-clp-cli": "memory import"
      }
    },
    "/memories/{owner_id}/spaces": {
      "get": {
        "operationId": "listSpaces",
        "summary": "List spaces",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpaceList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-10"
        ],
        "x-clp-permission": "`spaces:read`",
        "x-clp-cli": "spaces list",
        "x-clp-mcp-tool": "list_spaces"
      },
      "post": {
        "operationId": "createSpace",
        "summary": "Create a space",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpaceCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Space"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-10",
          "MEM-12",
          "MEM-28"
        ],
        "x-clp-permission": "`spaces:write`",
        "x-clp-cli": "spaces create",
        "x-clp-mcp-tool": "create_space"
      }
    },
    "/memories/{owner_id}/spaces/{space_id}": {
      "get": {
        "operationId": "getSpace",
        "summary": "Get a space",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/space_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Space"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-10"
        ],
        "x-clp-permission": "`spaces:read`",
        "x-clp-cli": "spaces get"
      },
      "patch": {
        "operationId": "updateSpace",
        "summary": "Update a space",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/space_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpaceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Space"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-12",
          "MEM-14",
          "MEM-28"
        ],
        "x-clp-permission": "`spaces:write`",
        "x-clp-cli": "spaces update"
      },
      "delete": {
        "operationId": "deleteSpace",
        "summary": "Delete a space (records are kept)",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/space_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Space"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-22"
        ],
        "x-clp-permission": "`spaces:write`",
        "x-clp-cli": "spaces delete"
      }
    },
    "/memories/{owner_id}/spaces/{space_id}/label": {
      "post": {
        "operationId": "label",
        "summary": "Label records with a space",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/space_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelResult"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-11",
          "MEM-12"
        ],
        "x-clp-permission": "`spaces:write`",
        "x-clp-cli": "spaces label",
        "x-clp-mcp-tool": "label"
      }
    },
    "/memories/{owner_id}/spaces/{space_id}/unlabel": {
      "post": {
        "operationId": "unlabel",
        "summary": "Remove a space label from records",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/space_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelResult"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-11"
        ],
        "x-clp-permission": "`spaces:write`",
        "x-clp-cli": "spaces unlabel",
        "x-clp-mcp-tool": "unlabel"
      }
    },
    "/memories/{owner_id}/suggestions": {
      "get": {
        "operationId": "listSuggestions",
        "summary": "List label suggestions",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "accepted",
                "rejected"
              ]
            }
          },
          {
            "name": "space_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SpaceId"
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuggestionList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-28",
          "MEM-32"
        ],
        "x-clp-permission": "`spaces:write`",
        "x-clp-cli": "suggestions list",
        "x-clp-mcp-tool": "list_suggestions",
        "x-clp-capability": "spaces.suggestions"
      }
    },
    "/memories/{owner_id}/suggestions/{suggestion_id}/accept": {
      "post": {
        "operationId": "acceptSuggestion",
        "summary": "Accept a label suggestion",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/suggestion_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Suggestion"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-32",
          "MEM-11"
        ],
        "x-clp-permission": "`spaces:write`",
        "x-clp-cli": "suggestions accept",
        "x-clp-mcp-tool": "accept_suggestion",
        "x-clp-capability": "spaces.suggestions"
      }
    },
    "/memories/{owner_id}/suggestions/{suggestion_id}/reject": {
      "post": {
        "operationId": "rejectSuggestion",
        "summary": "Reject a label suggestion",
        "tags": [
          "Spaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner_id"
          },
          {
            "$ref": "#/components/parameters/suggestion_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Suggestion"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "MEM-32"
        ],
        "x-clp-permission": "`spaces:write`",
        "x-clp-cli": "suggestions reject",
        "x-clp-mcp-tool": "reject_suggestion",
        "x-clp-capability": "spaces.suggestions"
      }
    },
    "/connectors": {
      "post": {
        "operationId": "createConnector",
        "summary": "Create a connector",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectorCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connector"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-1",
          "CONN-2",
          "CONN-27",
          "CONN-36"
        ],
        "x-clp-permission": "owner (principal), or `connectors:write` (org-owned)",
        "x-clp-cli": "connectors create"
      },
      "get": {
        "operationId": "listConnectors",
        "summary": "List connectors",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "owner_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OwnerId"
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-25"
        ],
        "x-clp-permission": "CONN-25",
        "x-clp-cli": "connectors list",
        "x-clp-mcp-tool": "list_connectors"
      }
    },
    "/connectors/{connector_id}": {
      "get": {
        "operationId": "getConnector",
        "summary": "Get a connector",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connector"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-25"
        ],
        "x-clp-permission": "CONN-25",
        "x-clp-cli": "connectors get"
      },
      "patch": {
        "operationId": "updateConnector",
        "summary": "Update a connector or its sync",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectorUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connector"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-3",
          "CONN-31",
          "CONN-32",
          "CONN-33",
          "CONN-35"
        ],
        "x-clp-permission": "owner, or `connectors:write`; `memory:write` on the sync target",
        "x-clp-cli": "connectors update"
      },
      "delete": {
        "operationId": "deleteConnector",
        "summary": "Delete a connector",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connector"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-4",
          "CONN-34"
        ],
        "x-clp-permission": "owner, or `connectors:write`",
        "x-clp-cli": "connectors delete"
      }
    },
    "/connectors/{connector_id}/connect": {
      "post": {
        "operationId": "connectConnector",
        "summary": "Link the external account",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectResult"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-6",
          "CONN-7",
          "CONN-8",
          "CONN-9"
        ],
        "x-clp-permission": "owner, or `connectors:write`",
        "x-clp-cli": "connectors connect"
      }
    },
    "/connectors/{connector_id}/disconnect": {
      "post": {
        "operationId": "disconnectConnector",
        "summary": "Unlink the external account",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connector"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-6",
          "CONN-9"
        ],
        "x-clp-permission": "owner, or `connectors:write`",
        "x-clp-cli": "connectors disconnect"
      }
    },
    "/connectors/{connector_id}/tools/{tool}": {
      "patch": {
        "operationId": "updateConnectorTool",
        "summary": "Classify or enable a tool",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/tool"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connector"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-16",
          "CONN-17",
          "CONN-18"
        ],
        "x-clp-permission": "owner, or `connectors:write`",
        "x-clp-cli": "connectors tool-update"
      }
    },
    "/connectors/{connector_id}/tools/{tool}/call": {
      "post": {
        "operationId": "callConnectorTool",
        "summary": "Call a connector tool",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/tool"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolCallRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-10",
          "CONN-11",
          "CONN-12",
          "CONN-13",
          "CONN-16",
          "CONN-20",
          "CONN-21",
          "CONN-24",
          "CONN-38",
          "AUTH-20"
        ],
        "x-clp-permission": "`connectors:use` (read tools) or `connectors:act` (action tools) through the access path",
        "x-clp-cli": "connectors call"
      }
    },
    "/connectors/{connector_id}/views": {
      "get": {
        "operationId": "listConnectorViews",
        "summary": "List views",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorViewList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-19",
          "CONN-25"
        ],
        "x-clp-permission": "CONN-25",
        "x-clp-cli": "views list",
        "x-clp-mcp-tool": "list_connector_views"
      },
      "post": {
        "operationId": "createConnectorView",
        "summary": "Create a view",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectorViewCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-19",
          "CONN-20",
          "CONN-23"
        ],
        "x-clp-permission": "owner, or `connectors:write`",
        "x-clp-cli": "views create"
      }
    },
    "/connectors/{connector_id}/views/{view_id}": {
      "get": {
        "operationId": "getConnectorView",
        "summary": "Get a view",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/view_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-19"
        ],
        "x-clp-permission": "CONN-25",
        "x-clp-cli": "views get"
      },
      "patch": {
        "operationId": "updateConnectorView",
        "summary": "Update a view",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/view_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectorViewUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-20",
          "CONN-22",
          "CONN-23"
        ],
        "x-clp-permission": "owner, or `connectors:write`",
        "x-clp-cli": "views update"
      },
      "delete": {
        "operationId": "deleteConnectorView",
        "summary": "Delete a view",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/connector_id"
          },
          {
            "$ref": "#/components/parameters/view_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-23"
        ],
        "x-clp-permission": "owner, or `connectors:write`",
        "x-clp-cli": "views delete"
      }
    },
    "/connector-types": {
      "get": {
        "operationId": "listConnectorTypes",
        "summary": "List native connector providers",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorTypeList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CONN-40"
        ],
        "x-clp-permission": "any authenticated principal",
        "x-clp-cli": "connectors types"
      }
    },
    "/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "List events from a readable log",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "log",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OwnerId"
            },
            "description": "Owner whose log to read. Defaults to the caller's principal log."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EventType"
            }
          },
          {
            "name": "actor_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PrincipalId"
            }
          },
          {
            "name": "subject_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "acting_org_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrgId"
            }
          },
          {
            "name": "occurred_after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
            }
          },
          {
            "name": "occurred_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "EVT-7",
          "EVT-8",
          "EVT-9",
          "EVT-13"
        ],
        "x-clp-permission": "principal log: the principal or controlling org `principals:audit.read`; org log: `audit:read`",
        "x-clp-cli": "events list"
      }
    },
    "/events/{event_id}": {
      "get": {
        "operationId": "getEvent",
        "summary": "Get an event",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/event_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "EVT-13"
        ],
        "x-clp-permission": "read access to a log containing it",
        "x-clp-cli": "events get"
      }
    },
    "/webhooks": {
      "post": {
        "operationId": "createWebhook",
        "summary": "Create a webhook subscription",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecret"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "EVT-14",
          "EVT-15"
        ],
        "x-clp-permission": "owner (`org:write` for orgs) and read access to the watched log",
        "x-clp-cli": "webhooks create"
      },
      "get": {
        "operationId": "listWebhooks",
        "summary": "List webhooks",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "name": "owner_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OwnerId"
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "EVT-14"
        ],
        "x-clp-permission": "owner",
        "x-clp-cli": "webhooks list"
      }
    },
    "/webhooks/{webhook_id}": {
      "get": {
        "operationId": "getWebhook",
        "summary": "Get a webhook",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/webhook_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "EVT-14"
        ],
        "x-clp-permission": "owner",
        "x-clp-cli": "webhooks get"
      },
      "patch": {
        "operationId": "updateWebhook",
        "summary": "Update a webhook",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/webhook_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "EVT-14"
        ],
        "x-clp-permission": "owner",
        "x-clp-cli": "webhooks update"
      },
      "delete": {
        "operationId": "deleteWebhook",
        "summary": "Delete a webhook",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/webhook_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "EVT-14"
        ],
        "x-clp-permission": "owner",
        "x-clp-cli": "webhooks delete"
      }
    },
    "/operations/{operation_id}": {
      "get": {
        "operationId": "getOperation",
        "summary": "Get an operation",
        "tags": [
          "Operations"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/operation_id"
          },
          {
            "$ref": "#/components/parameters/CLP-Version"
          },
          {
            "$ref": "#/components/parameters/CLP-Org"
          },
          {
            "$ref": "#/components/parameters/DPoP"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "x-clp-rules": [
          "CORE-27",
          "CORE-28"
        ],
        "x-clp-permission": "the principal that started it",
        "x-clp-cli": "operations get"
      }
    },
    "/.well-known/context-layer": {
      "get": {
        "operationId": "getDiscovery",
        "summary": "Discovery document",
        "tags": [
          "Discovery"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CLP-Version"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "CLP-Request-Id": {
                "$ref": "#/components/headers/CLP-Request-Id"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryDocument"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Problem4XX"
          },
          "5XX": {
            "$ref": "#/components/responses/Problem5XX"
          }
        },
        "security": [],
        "x-clp-rules": [
          "DISC-1",
          "DISC-2"
        ],
        "x-clp-permission": "none"
      },
      "servers": [
        {
          "url": "https://{issuer_host}",
          "variables": {
            "issuer_host": {
              "default": "second.example"
            }
          }
        }
      ]
    }
  },
  "webhooks": {
    "event": {
      "post": {
        "operationId": "deliverEvent",
        "summary": "Event delivery (Standard Webhooks)",
        "description": "Signed with `webhook-id`, `webhook-timestamp`, `webhook-signature` (EVT-15). At-least-once; dedupe by event id (EVT-16).",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Accepted"
          }
        },
        "x-clp-rules": [
          "EVT-14",
          "EVT-15",
          "EVT-16",
          "EVT-17",
          "EVT-18",
          "EVT-19"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "PrincipalId": {
        "type": "string",
        "pattern": "^prn_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`prn_` identifier (CORE-2)."
      },
      "OrgId": {
        "type": "string",
        "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`org_` identifier (CORE-2)."
      },
      "MembershipId": {
        "type": "string",
        "pattern": "^mbr_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`mbr_` identifier (CORE-2)."
      },
      "RoleId": {
        "type": "string",
        "pattern": "^rol_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`rol_` identifier (CORE-2)."
      },
      "GrantId": {
        "type": "string",
        "pattern": "^grt_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`grt_` identifier (CORE-2)."
      },
      "CredentialId": {
        "type": "string",
        "pattern": "^cred_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`cred_` identifier (CORE-2)."
      },
      "AppId": {
        "type": "string",
        "pattern": "^app_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`app_` identifier (CORE-2)."
      },
      "McpServerId": {
        "type": "string",
        "pattern": "^mcp_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`mcp_` identifier (CORE-2)."
      },
      "SpaceId": {
        "type": "string",
        "pattern": "^spc_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`spc_` identifier (CORE-2)."
      },
      "RecordId": {
        "type": "string",
        "pattern": "^rec_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`rec_` identifier (CORE-2)."
      },
      "EventId": {
        "type": "string",
        "pattern": "^evt_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`evt_` identifier (CORE-2)."
      },
      "OperationId": {
        "type": "string",
        "pattern": "^op_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`op_` identifier (CORE-2)."
      },
      "RequestId": {
        "type": "string",
        "pattern": "^req_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`req_` identifier (CORE-2)."
      },
      "WebhookId": {
        "type": "string",
        "pattern": "^whk_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`whk_` identifier (CORE-2)."
      },
      "SuggestionId": {
        "type": "string",
        "pattern": "^sug_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`sug_` identifier (CORE-2)."
      },
      "ConnectorId": {
        "type": "string",
        "pattern": "^con_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`con_` identifier (CORE-2)."
      },
      "ConnectorViewId": {
        "type": "string",
        "pattern": "^cvw_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "`cvw_` identifier (CORE-2)."
      },
      "OwnerId": {
        "type": "string",
        "pattern": "^(prn|org)_[0-9a-hjkmnp-tv-z]{26}$",
        "description": "Id of an owner: a principal or an org (CORE-33)."
      },
      "Problem": {
        "type": "object",
        "description": "RFC 9457 Problem Details with CLP extension members (CORE-20).",
        "required": [
          "type",
          "title",
          "status",
          "code",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "`https://contextlayerprotocol.gdrl.dev/errors/<code>`"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "code": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "unknown_parameter",
                  "unsupported_version",
                  "unauthenticated",
                  "permission_denied",
                  "not_found",
                  "conflict",
                  "idempotency_conflict",
                  "rate_limited",
                  "internal_error",
                  "principal_pending",
                  "principal_suspended",
                  "email_not_verified",
                  "claim_code_used",
                  "already_controlled",
                  "handle_taken",
                  "last_owner",
                  "claim_code_invalid",
                  "not_a_member",
                  "admission_denied",
                  "join_blocked",
                  "org_suspended",
                  "policy_violation",
                  "membership_exists",
                  "invitation_expired",
                  "not_controlled",
                  "controlled_membership_locked",
                  "escalation_denied",
                  "grant_expired",
                  "grant_exhausted",
                  "grant_revoked",
                  "external_sharing_disallowed",
                  "grant_pending",
                  "invalid_token",
                  "token_expired",
                  "credential_revoked",
                  "dpop_required",
                  "invalid_grant",
                  "refresh_token_reused",
                  "delegation_depth_exceeded",
                  "credential_restriction",
                  "app_suspended",
                  "consent_required",
                  "connection_pending_approval",
                  "connections_blocked",
                  "app_not_allowed",
                  "app_memory_access_disallowed",
                  "invalid_client",
                  "invalid_redirect_uri",
                  "installation_not_found",
                  "mcp_server_not_found",
                  "record_not_found",
                  "space_not_found",
                  "content_immutable",
                  "target_not_allowed",
                  "import_invalid",
                  "webhook_url_invalid",
                  "log_not_readable",
                  "connector_not_found",
                  "connector_auth_expired",
                  "connector_unavailable",
                  "tool_not_allowed",
                  "constraint_violation"
                ]
              },
              {
                "type": "string",
                "pattern": "^x_[a-z0-9]+_[a-z0-9_]+$"
              }
            ],
            "description": "Stable error code (CORE-21); hosts may add `x_<host>_` codes (CORE-30)."
          },
          "param": {
            "type": [
              "string",
              "null"
            ]
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "moved_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Issuer of the host a principal moved to (DISC-13). Only on `not_found` for principals."
          }
        }
      },
      "ListEnvelope": {
        "type": "object",
        "description": "Cursor-paginated list (CORE-24).",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array"
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Operation": {
        "type": "object",
        "required": [
          "id",
          "object",
          "kind",
          "status",
          "result",
          "error",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/OperationId"
          },
          "object": {
            "type": "string",
            "const": "operation"
          },
          "kind": {
            "type": "string",
            "description": "e.g. `memory.export`, `memory.import`."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ExportResult"
              },
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when `succeeded` (CORE-28). For `memory.export`, an ExportResult."
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Problem"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        },
        "description": "Long-running operation (CORE-27, CORE-28)."
      },
      "OwnerRef": {
        "type": "object",
        "description": "Owner reference (CORE-33).",
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "principal",
              "org"
            ]
          },
          "id": {
            "$ref": "#/components/schemas/OwnerId"
          }
        }
      },
      "MemoryRef": {
        "type": "object",
        "description": "A whole memory, referenced by its owner's id (MEM-1).",
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "memory"
          },
          "id": {
            "$ref": "#/components/schemas/OwnerId"
          }
        }
      },
      "SpaceRef": {
        "type": "object",
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "space"
          },
          "id": {
            "$ref": "#/components/schemas/SpaceId"
          }
        }
      },
      "ConnectorRef": {
        "type": "object",
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "connector"
          },
          "id": {
            "$ref": "#/components/schemas/ConnectorId"
          }
        }
      },
      "ConnectorViewRef": {
        "type": "object",
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "connector_view"
          },
          "id": {
            "$ref": "#/components/schemas/ConnectorViewId"
          }
        }
      },
      "ResourceRef": {
        "description": "A grantable resource (AUTH-12).",
        "oneOf": [
          {
            "$ref": "#/components/schemas/SpaceRef"
          },
          {
            "$ref": "#/components/schemas/MemoryRef"
          },
          {
            "$ref": "#/components/schemas/ConnectorRef"
          },
          {
            "$ref": "#/components/schemas/ConnectorViewRef"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "Permission": {
        "description": "`<resource>:<action>` (AUTH-1). Standard permissions, or host extensions `x_<host>.<resource>:<action>` (AUTH-3).",
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "org:read",
              "org:write",
              "org:delete",
              "org:policy.write",
              "members:read",
              "members:invite",
              "members:write",
              "members:remove",
              "roles:read",
              "roles:write",
              "grants:accept",
              "billing:read",
              "billing:write",
              "audit:read",
              "principals:claim",
              "principals:create",
              "principals:transfer",
              "principals:release",
              "principals:write",
              "principals:credentials",
              "principals:suspend",
              "principals:delete",
              "principals:audit.read",
              "principals:memory",
              "apps:read",
              "apps:write",
              "apps:install",
              "apps:approve",
              "mcp:read",
              "mcp:write",
              "memory:read",
              "memory:read.private",
              "memory:write",
              "memory:forget",
              "spaces:read",
              "spaces:write",
              "spaces:share",
              "connectors:read",
              "connectors:use",
              "connectors:act",
              "connectors:write",
              "connectors:share",
              "principals:connectors"
            ]
          },
          {
            "type": "string",
            "pattern": "^x_[a-z0-9]+\\.[a-z_]+:[a-z_.]+$"
          }
        ]
      },
      "Permissions": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Permission"
        },
        "uniqueItems": true
      },
      "AccessLevel": {
        "type": "string",
        "enum": [
          "memory:read",
          "memory:write",
          "connectors:use",
          "connectors:act"
        ],
        "description": "Memory levels apply to spaces and memories; connector levels to connectors and views (APP-29, CONN-29)."
      },
      "EstablishmentMethod": {
        "description": "ID-9. Standard methods, or host extensions `x_<host>_<method>`.",
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "email_verified",
              "payment_method",
              "phone_verified",
              "controlled"
            ]
          },
          {
            "type": "string",
            "pattern": "^x_[a-z0-9]+_[a-z0-9_]+$"
          }
        ]
      },
      "EstablishmentPolicy": {
        "description": "Host establishment policy (ID-8): `all` or `any` over methods, nestable.",
        "oneOf": [
          {
            "type": "object",
            "required": [
              "all"
            ],
            "additionalProperties": false,
            "properties": {
              "all": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/EstablishmentMethod"
                    },
                    {
                      "$ref": "#/components/schemas/EstablishmentPolicy"
                    }
                  ]
                },
                "minItems": 1
              }
            }
          },
          {
            "type": "object",
            "required": [
              "any"
            ],
            "additionalProperties": false,
            "properties": {
              "any": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/EstablishmentMethod"
                    },
                    {
                      "$ref": "#/components/schemas/EstablishmentPolicy"
                    }
                  ]
                },
                "minItems": 1
              }
            }
          }
        ]
      },
      "Establishment": {
        "type": "object",
        "required": [
          "established_at",
          "satisfied",
          "missing"
        ],
        "properties": {
          "established_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "satisfied": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EstablishmentMethod"
            }
          },
          "missing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EstablishmentMethod"
            }
          }
        }
      },
      "Principal": {
        "type": "object",
        "required": [
          "id",
          "object",
          "kind",
          "status",
          "handle",
          "display_name",
          "description",
          "email",
          "email_verified",
          "controlled_by_org_id",
          "default_org_id",
          "auto_accept_grants",
          "establishment",
          "expires_at",
          "metadata",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "object": {
            "type": "string",
            "const": "principal"
          },
          "kind": {
            "type": "string",
            "enum": [
              "human",
              "agent"
            ],
            "description": "A label only (ID-2). Immutable (ID-3)."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "suspended",
              "deleted"
            ]
          },
          "handle": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z0-9](?:[a-z0-9-]{1,37}[a-z0-9])$",
            "description": "3–39 characters; shared namespace with orgs (ID-27, ID-28)."
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "email_verified": {
            "type": "boolean"
          },
          "controlled_by_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ]
          },
          "auto_accept_grants": {
            "type": "boolean",
            "description": "Grants become active without acceptance (AUTH-17)."
          },
          "establishment": {
            "$ref": "#/components/schemas/Establishment"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set while `pending` (ID-12)."
          },
          "metadata": {
            "type": "object",
            "description": "Free-form client metadata.",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        },
        "description": "A principal, as visible to itself or to its controlling org (ID-31)."
      },
      "PrincipalProfile": {
        "type": "object",
        "required": [
          "id",
          "object",
          "kind",
          "handle",
          "display_name",
          "description",
          "controlled_by_org_id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "object": {
            "type": "string",
            "const": "principal_profile"
          },
          "kind": {
            "type": "string",
            "enum": [
              "human",
              "agent"
            ]
          },
          "handle": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z0-9](?:[a-z0-9-]{1,37}[a-z0-9])$",
            "description": "3–39 characters; shared namespace with orgs (ID-27, ID-28)."
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "controlled_by_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "description": "Public profile of another principal (ID-30)."
      },
      "PublicKeyJwk": {
        "type": "object",
        "description": "Public JWK for key-pair sign-in (ID-18). Private members MUST NOT be sent.",
        "required": [
          "kty"
        ],
        "additionalProperties": true,
        "properties": {
          "kty": {
            "type": "string",
            "enum": [
              "OKP",
              "EC",
              "RSA"
            ]
          },
          "crv": {
            "type": "string"
          },
          "x": {
            "type": "string"
          },
          "y": {
            "type": "string"
          },
          "n": {
            "type": "string"
          },
          "e": {
            "type": "string"
          },
          "kid": {
            "type": "string"
          },
          "alg": {
            "type": "string"
          }
        },
        "not": {
          "anyOf": [
            {
              "required": [
                "d"
              ]
            },
            {
              "required": [
                "p"
              ]
            },
            {
              "required": [
                "q"
              ]
            }
          ]
        }
      },
      "SignupRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "human",
              "agent"
            ]
          },
          "handle": {
            "type": "string",
            "pattern": "^[a-z0-9](?:[a-z0-9-]{1,37}[a-z0-9])$",
            "description": "3–39 characters; shared namespace with orgs (ID-27, ID-28)."
          },
          "display_name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "public_key": {
            "$ref": "#/components/schemas/PublicKeyJwk"
          },
          "request_claim_code": {
            "type": "boolean",
            "description": "Return a claim code in the same call (ID-22). Agent clients SHOULD set this."
          },
          "metadata": {
            "type": "object",
            "description": "Free-form client metadata.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "kind"
        ],
        "description": "Signup is `create principal` (ID-16)."
      },
      "SignupResult": {
        "type": "object",
        "required": [
          "object",
          "principal",
          "claim_code",
          "api_key",
          "credential"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "signup"
          },
          "principal": {
            "$ref": "#/components/schemas/Principal"
          },
          "claim_code": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^clp_claim_",
            "description": "Shown once (CORE-8)."
          },
          "api_key": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^clp_sk_",
            "description": "Returned once when no other sign-in method was registered (ID-19)."
          },
          "credential": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Credential"
              },
              {
                "type": "null"
              }
            ],
            "description": "The api_key or public_key credential created at signup."
          }
        },
        "description": "ID-37."
      },
      "PrincipalUpdate": {
        "type": "object",
        "properties": {
          "handle": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z0-9](?:[a-z0-9-]{1,37}[a-z0-9])$",
            "description": "3–39 characters; shared namespace with orgs (ID-27, ID-28)."
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "Changing it resets `email_verified` (ID-17)."
          },
          "default_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ]
          },
          "auto_accept_grants": {
            "type": "boolean"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Free-form client metadata.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "description": "JSON Merge Patch (BIND-5).",
        "minProperties": 1
      },
      "ClaimCode": {
        "type": "object",
        "required": [
          "object",
          "principal_id",
          "claim_code",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "claim_code"
          },
          "principal_id": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "claim_code": {
            "type": "string",
            "pattern": "^clp_claim_",
            "description": "Shown once (CORE-8)."
          },
          "created_by": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        },
        "description": "Issuing a new code invalidates the previous one (ID-24)."
      },
      "EmailVerificationRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "description": "Sends a one-time code to the principal's email (ID-17)."
      },
      "EmailVerify": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "code"
        ]
      },
      "Me": {
        "type": "object",
        "required": [
          "object",
          "principal",
          "credential",
          "acting_org_id",
          "default_org_id",
          "controlled_by_org_id",
          "establishment",
          "memberships",
          "delegation_chain"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "me"
          },
          "principal": {
            "$ref": "#/components/schemas/Principal"
          },
          "credential": {
            "$ref": "#/components/schemas/Credential"
          },
          "acting_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ],
            "description": "`null` in personal context (ORG-35, ORG-43)."
          },
          "default_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ]
          },
          "controlled_by_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ]
          },
          "establishment": {
            "$ref": "#/components/schemas/Establishment"
          },
          "memberships": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Membership"
            }
          },
          "delegation_chain": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrincipalId"
            },
            "maxItems": 5,
            "description": "`act` chain, outermost actor first (CRED-15, CRED-17)."
          }
        },
        "description": "GET /me (ID-32)."
      },
      "OrgPolicy": {
        "type": "object",
        "description": "Org policy (2.9). Restricts only (ORG-32).",
        "required": [
          "admission",
          "external_sharing",
          "apps",
          "controlled_may_join_other_orgs",
          "controlled_may_connect_apps",
          "controlled_may_install_apps",
          "controlled_may_create_mcp_servers",
          "controlled_may_create_connectors",
          "controlled_may_self_delete",
          "default_member_role_id",
          "connectors"
        ],
        "properties": {
          "admission": {
            "type": "object",
            "required": [
              "allowed_kinds",
              "members_must_be_controlled_by_this_org"
            ],
            "properties": {
              "allowed_kinds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "human",
                    "agent"
                  ]
                },
                "uniqueItems": true
              },
              "members_must_be_controlled_by_this_org": {
                "type": "boolean"
              }
            }
          },
          "external_sharing": {
            "type": "string",
            "enum": [
              "allowed",
              "disallowed"
            ]
          },
          "apps": {
            "type": "object",
            "required": [
              "allowed_app_ids",
              "connections",
              "org_memory_access",
              "org_connector_access"
            ],
            "properties": {
              "allowed_app_ids": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "$ref": "#/components/schemas/AppId"
                }
              },
              "connections": {
                "type": "string",
                "enum": [
                  "open",
                  "admin_approval",
                  "disabled"
                ]
              },
              "org_memory_access": {
                "type": "string",
                "enum": [
                  "allowed",
                  "disallowed"
                ]
              },
              "org_connector_access": {
                "type": "string",
                "enum": [
                  "allowed",
                  "disallowed"
                ]
              }
            }
          },
          "connectors": {
            "type": "object",
            "required": [
              "allowed_providers",
              "remote_mcp",
              "actions",
              "audit_action_arguments"
            ],
            "description": "CONN-36.",
            "properties": {
              "allowed_providers": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "remote_mcp": {
                "type": "string",
                "enum": [
                  "allowed",
                  "disallowed"
                ]
              },
              "actions": {
                "type": "string",
                "enum": [
                  "allowed",
                  "disabled"
                ]
              },
              "audit_action_arguments": {
                "type": "boolean"
              }
            }
          },
          "controlled_may_join_other_orgs": {
            "type": "boolean"
          },
          "controlled_may_connect_apps": {
            "type": "boolean"
          },
          "controlled_may_install_apps": {
            "type": "boolean"
          },
          "controlled_may_create_mcp_servers": {
            "type": "boolean"
          },
          "controlled_may_create_connectors": {
            "type": "boolean"
          },
          "controlled_may_self_delete": {
            "type": "boolean"
          },
          "default_member_role_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RoleId"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "OrgPolicyPatch": {
        "type": "object",
        "description": "JSON Merge Patch of OrgPolicy. Requires `org:policy.write` (ORG-32).",
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "properties": {
          "admission": {
            "type": "object",
            "properties": {
              "allowed_kinds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "human",
                    "agent"
                  ]
                },
                "uniqueItems": true
              },
              "members_must_be_controlled_by_this_org": {
                "type": "boolean"
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            }
          },
          "external_sharing": {
            "type": "string",
            "enum": [
              "allowed",
              "disallowed"
            ]
          },
          "apps": {
            "type": "object",
            "properties": {
              "allowed_app_ids": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "$ref": "#/components/schemas/AppId"
                }
              },
              "connections": {
                "type": "string",
                "enum": [
                  "open",
                  "admin_approval",
                  "disabled"
                ]
              },
              "org_memory_access": {
                "type": "string",
                "enum": [
                  "allowed",
                  "disallowed"
                ]
              },
              "org_connector_access": {
                "type": "string",
                "enum": [
                  "allowed",
                  "disallowed"
                ]
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            }
          },
          "connectors": {
            "type": "object",
            "properties": {
              "allowed_providers": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "remote_mcp": {
                "type": "string",
                "enum": [
                  "allowed",
                  "disallowed"
                ]
              },
              "actions": {
                "type": "string",
                "enum": [
                  "allowed",
                  "disabled"
                ]
              },
              "audit_action_arguments": {
                "type": "boolean"
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            }
          },
          "controlled_may_join_other_orgs": {
            "type": "boolean"
          },
          "controlled_may_connect_apps": {
            "type": "boolean"
          },
          "controlled_may_install_apps": {
            "type": "boolean"
          },
          "controlled_may_create_mcp_servers": {
            "type": "boolean"
          },
          "controlled_may_create_connectors": {
            "type": "boolean"
          },
          "controlled_may_self_delete": {
            "type": "boolean"
          },
          "default_member_role_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RoleId"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Org": {
        "type": "object",
        "required": [
          "id",
          "object",
          "status",
          "handle",
          "display_name",
          "description",
          "auto_accept_grants",
          "policy",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/OrgId"
          },
          "object": {
            "type": "string",
            "const": "org"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "deleted"
            ]
          },
          "handle": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z0-9](?:[a-z0-9-]{1,37}[a-z0-9])$",
            "description": "3–39 characters; shared namespace with orgs (ID-27, ID-28)."
          },
          "display_name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "auto_accept_grants": {
            "type": "boolean",
            "description": "Grants to the org become active without acceptance (ORG-4, AUTH-17)."
          },
          "policy": {
            "$ref": "#/components/schemas/OrgPolicy"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "OrgCreate": {
        "type": "object",
        "properties": {
          "handle": {
            "type": "string",
            "pattern": "^[a-z0-9](?:[a-z0-9-]{1,37}[a-z0-9])$",
            "description": "3–39 characters; shared namespace with orgs (ID-27, ID-28)."
          },
          "display_name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "auto_accept_grants": {
            "type": "boolean"
          },
          "policy": {
            "$ref": "#/components/schemas/OrgPolicyPatch"
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "display_name"
        ],
        "description": "The creator becomes its first owner (ORG-7)."
      },
      "OrgUpdate": {
        "type": "object",
        "properties": {
          "handle": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z0-9](?:[a-z0-9-]{1,37}[a-z0-9])$",
            "description": "3–39 characters; shared namespace with orgs (ID-27, ID-28)."
          },
          "display_name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "auto_accept_grants": {
            "type": "boolean"
          },
          "policy": {
            "$ref": "#/components/schemas/OrgPolicyPatch"
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "description": "JSON Merge Patch. `policy` requires `org:policy.write`; other fields `org:write`.",
        "minProperties": 1
      },
      "Membership": {
        "type": "object",
        "required": [
          "id",
          "object",
          "org_id",
          "principal_id",
          "invited_email",
          "role_ids",
          "status",
          "invited_by",
          "joined_at",
          "removed_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/MembershipId"
          },
          "object": {
            "type": "string",
            "const": "membership"
          },
          "org_id": {
            "$ref": "#/components/schemas/OrgId"
          },
          "principal_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrincipalId"
              },
              {
                "type": "null"
              }
            ],
            "description": "`null` only for an email invitation not yet attached (ORG-12)."
          },
          "invited_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "Set only on unattached email invitations (ORG-12)."
          },
          "role_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleId"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "invited",
              "active",
              "removed"
            ]
          },
          "invited_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrincipalId"
              },
              {
                "type": "null"
              }
            ]
          },
          "joined_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "removed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "InvitationCreate": {
        "description": "Invite an existing principal by id or anyone by email (ORG-12).",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "principal_id": {
                "$ref": "#/components/schemas/PrincipalId"
              },
              "role_ids": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RoleId"
                }
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            },
            "required": [
              "principal_id"
            ]
          },
          {
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "format": "email"
              },
              "role_ids": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RoleId"
                }
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            },
            "required": [
              "email"
            ]
          }
        ]
      },
      "MembershipUpdate": {
        "type": "object",
        "properties": {
          "role_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleId"
            },
            "minItems": 1
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "role_ids"
        ],
        "description": "No escalation (AUTH-9, AUTH-10, AUTH-11)."
      },
      "ClaimRequest": {
        "type": "object",
        "properties": {
          "claim_code": {
            "type": "string",
            "pattern": "^clp_claim_"
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "claim_code"
        ],
        "description": "ORG-17, ORG-18."
      },
      "ControlledPrincipalCreate": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "human",
              "agent"
            ]
          },
          "handle": {
            "type": "string",
            "pattern": "^[a-z0-9](?:[a-z0-9-]{1,37}[a-z0-9])$",
            "description": "3–39 characters; shared namespace with orgs (ID-27, ID-28)."
          },
          "display_name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "public_key": {
            "$ref": "#/components/schemas/PublicKeyJwk"
          },
          "role_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleId"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Free-form client metadata.",
            "additionalProperties": true
          },
          "issue_api_key": {
            "type": "boolean",
            "description": "Also issue an api_key held by the new principal, bound to this org."
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "kind"
        ],
        "description": "Create a principal controlled by the org (ID-36, ORG-19)."
      },
      "Role": {
        "type": "object",
        "required": [
          "id",
          "object",
          "org_id",
          "key",
          "name",
          "description",
          "permissions",
          "built_in",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/RoleId"
          },
          "object": {
            "type": "string",
            "const": "role"
          },
          "org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ],
            "description": "`null` for built-in roles (AUTH-5)."
          },
          "key": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "owner",
              "admin",
              "member",
              null
            ],
            "description": "Identifies built-in roles; `null` for custom roles (AUTH-5)."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "permissions": {
            "$ref": "#/components/schemas/Permissions",
            "description": "Explicit list; the built-in `owner` role lists every current standard permission (AUTH-6)."
          },
          "built_in": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "RoleCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "permissions": {
            "$ref": "#/components/schemas/Permissions"
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "name",
          "permissions"
        ]
      },
      "RoleUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "permissions": {
            "$ref": "#/components/schemas/Permissions"
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "minProperties": 1
      },
      "Grantee": {
        "type": "object",
        "description": "AUTH-13.",
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "principal",
              "org"
            ]
          },
          "id": {
            "$ref": "#/components/schemas/OwnerId"
          }
        }
      },
      "GrantConditions": {
        "type": "object",
        "required": [
          "expires_at",
          "max_uses",
          "uses",
          "allow_app_access"
        ],
        "properties": {
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "max_uses": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "uses": {
            "type": "integer",
            "minimum": 0
          },
          "allow_app_access": {
            "type": "boolean"
          }
        }
      },
      "Grant": {
        "type": "object",
        "required": [
          "id",
          "object",
          "resource",
          "owner",
          "grantee",
          "permissions",
          "conditions",
          "status",
          "issued_by",
          "acting_org_id",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/GrantId"
          },
          "object": {
            "type": "string",
            "const": "grant"
          },
          "resource": {
            "$ref": "#/components/schemas/ResourceRef"
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerRef",
            "description": "The resource's owner (AUTH-14)."
          },
          "grantee": {
            "$ref": "#/components/schemas/Grantee"
          },
          "permissions": {
            "$ref": "#/components/schemas/Permissions"
          },
          "conditions": {
            "$ref": "#/components/schemas/GrantConditions"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "declined",
              "revoked",
              "expired"
            ]
          },
          "issued_by": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "acting_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "GrantCreate": {
        "type": "object",
        "properties": {
          "resource": {
            "$ref": "#/components/schemas/ResourceRef"
          },
          "grantee": {
            "$ref": "#/components/schemas/Grantee"
          },
          "permissions": {
            "$ref": "#/components/schemas/Permissions"
          },
          "conditions": {
            "type": "object",
            "properties": {
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
              },
              "max_uses": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1
              },
              "allow_app_access": {
                "type": "boolean"
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            }
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "resource",
          "grantee",
          "permissions"
        ]
      },
      "CheckRequest": {
        "type": "object",
        "properties": {
          "permission": {
            "$ref": "#/components/schemas/Permission"
          },
          "resource": {
            "description": "Resource the action targets, if any.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResourceRef"
              },
              {
                "$ref": "#/components/schemas/OwnerRef"
              }
            ]
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "permission"
        ],
        "description": "Evaluates only the calling principal and credential (AUTH-22)."
      },
      "CheckResult": {
        "type": "object",
        "required": [
          "object",
          "decision",
          "code"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "check_result"
          },
          "decision": {
            "type": "string",
            "enum": [
              "allow",
              "deny"
            ]
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "On deny, the error code the action would fail with."
          }
        }
      },
      "Binding": {
        "description": "Context a credential acts in (CRED-6).",
        "anyOf": [
          {
            "type": "object",
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "org"
              },
              "id": {
                "$ref": "#/components/schemas/OrgId"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "personal"
              }
            }
          },
          {
            "type": "null"
          }
        ]
      },
      "Credential": {
        "type": "object",
        "required": [
          "id",
          "object",
          "type",
          "holder_id",
          "app_id",
          "name",
          "binding",
          "permissions",
          "resources",
          "prefix",
          "public_key",
          "status",
          "expires_at",
          "last_used_at",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/CredentialId"
          },
          "object": {
            "type": "string",
            "const": "credential"
          },
          "type": {
            "type": "string",
            "enum": [
              "session",
              "api_key",
              "public_key"
            ]
          },
          "holder_id": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "app_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppId"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set for app connections and installations (CRED-21)."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "binding": {
            "$ref": "#/components/schemas/Binding"
          },
          "permissions": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Permissions"
              },
              {
                "type": "null"
              }
            ],
            "description": "`null` = the holder's full permissions (sessions only, CRED-7)."
          },
          "resources": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ResourceRef"
            },
            "description": "`null` = no resource restriction (CRED-5)."
          },
          "prefix": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display prefix of the secret (CORE-8). `null` for public_key."
          },
          "public_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PublicKeyJwk"
              },
              {
                "type": "null"
              }
            ],
            "description": "JWK, only for `public_key` credentials (CRED-1)."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked",
              "expired",
              "pending_approval"
            ],
            "description": "`pending_approval`: app connections awaiting approval (CRED-4, APP-14)."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "created_by": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "CredentialCreate": {
        "description": "Create an api_key or register a public key (CRED-18). Sessions are created only by sign-in.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "api_key"
              },
              "holder_id": {
                "$ref": "#/components/schemas/PrincipalId"
              },
              "name": {
                "type": "string"
              },
              "binding": {
                "description": "Required, non-null (CRED-6).",
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "const": "org"
                      },
                      "id": {
                        "$ref": "#/components/schemas/OrgId"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "const": "personal"
                      }
                    }
                  }
                ]
              },
              "permissions": {
                "$ref": "#/components/schemas/Permissions"
              },
              "resources": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "$ref": "#/components/schemas/ResourceRef"
                }
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            },
            "required": [
              "type",
              "binding",
              "permissions"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "public_key"
              },
              "holder_id": {
                "$ref": "#/components/schemas/PrincipalId"
              },
              "name": {
                "type": "string"
              },
              "public_key": {
                "$ref": "#/components/schemas/PublicKeyJwk"
              },
              "binding": {
                "$ref": "#/components/schemas/Binding"
              },
              "permissions": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Permissions"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "resources": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "$ref": "#/components/schemas/ResourceRef"
                }
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            },
            "required": [
              "type",
              "public_key"
            ]
          }
        ]
      },
      "CredentialSecret": {
        "type": "object",
        "required": [
          "object",
          "credential",
          "secret",
          "previous_secret_expires_at"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "credential_secret"
          },
          "credential": {
            "$ref": "#/components/schemas/Credential"
          },
          "secret": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^clp_sk_",
            "description": "Shown once (CORE-8). `null` for public_key."
          },
          "previous_secret_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Rotation grace period end (CRED-19)."
          }
        }
      },
      "CredentialRotate": {
        "type": "object",
        "properties": {
          "grace_period": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400,
            "description": "Seconds the previous secret stays valid (CRED-19)."
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        }
      },
      "ConnectionUpdate": {
        "type": "object",
        "properties": {
          "permissions": {
            "$ref": "#/components/schemas/Permissions"
          },
          "resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceRef"
            }
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "description": "May add or remove resources the principal can access and reduce access levels; never add an unapproved access level (APP-15).",
        "minProperties": 1
      },
      "TokenRequest": {
        "type": "object",
        "description": "OAuth 2.1 token request (CRED-9). Form-encoded.",
        "required": [
          "grant_type"
        ],
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "authorization_code",
              "refresh_token",
              "client_credentials",
              "urn:ietf:params:oauth:grant-type:device_code",
              "urn:ietf:params:oauth:grant-type:jwt-bearer",
              "urn:ietf:params:oauth:grant-type:token-exchange",
              "urn:clp:grant-type:email-otp"
            ]
          },
          "code": {
            "type": "string"
          },
          "redirect_uri": {
            "type": "string",
            "format": "uri"
          },
          "code_verifier": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "client_assertion": {
            "type": "string"
          },
          "client_assertion_type": {
            "type": "string"
          },
          "refresh_token": {
            "type": "string",
            "pattern": "^clp_rt_"
          },
          "device_code": {
            "type": "string"
          },
          "assertion": {
            "type": "string"
          },
          "subject_token": {
            "type": "string"
          },
          "subject_token_type": {
            "type": "string"
          },
          "actor_token": {
            "type": "string"
          },
          "actor_token_type": {
            "type": "string"
          },
          "requested_token_type": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "resource": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "otp": {
            "type": "string"
          },
          "org": {
            "type": "string",
            "description": "Context for the session: an org id or `personal`."
          },
          "principal_id": {
            "$ref": "#/components/schemas/PrincipalId",
            "description": "Installation principal, for client_credentials (APP-25)."
          }
        }
      },
      "TokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "pattern": "^clp_at_"
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer",
              "DPoP",
              "N_A"
            ]
          },
          "expires_in": {
            "type": "integer",
            "maximum": 3600,
            "description": "≤ 1 hour (CRED-11)."
          },
          "refresh_token": {
            "type": "string",
            "pattern": "^clp_rt_"
          },
          "scope": {
            "type": "string"
          },
          "id_token": {
            "type": "string"
          },
          "issued_token_type": {
            "type": "string"
          }
        }
      },
      "OAuthError": {
        "type": "object",
        "description": "RFC 6749 §5.2 error, extended with `code` and `request_id` (CORE-35).",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          },
          "error_uri": {
            "type": "string",
            "format": "uri"
          },
          "code": {
            "type": "string"
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          }
        }
      },
      "DeviceAuthorizationResponse": {
        "type": "object",
        "description": "RFC 8628 §3.2.",
        "required": [
          "device_code",
          "user_code",
          "verification_uri",
          "expires_in"
        ],
        "properties": {
          "device_code": {
            "type": "string"
          },
          "user_code": {
            "type": "string"
          },
          "verification_uri": {
            "type": "string",
            "format": "uri"
          },
          "verification_uri_complete": {
            "type": "string",
            "format": "uri"
          },
          "expires_in": {
            "type": "integer"
          },
          "interval": {
            "type": "integer"
          }
        }
      },
      "App": {
        "type": "object",
        "required": [
          "id",
          "object",
          "owner_org_id",
          "name",
          "description",
          "logo_url",
          "homepage_url",
          "privacy_policy_url",
          "terms_url",
          "webhook_url",
          "redirect_uris",
          "client_type",
          "client_auth",
          "jwks_uri",
          "verification",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/AppId",
            "description": "Also the OAuth `client_id` (APP-1)."
          },
          "object": {
            "type": "string",
            "const": "app"
          },
          "owner_org_id": {
            "$ref": "#/components/schemas/OrgId"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "homepage_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "privacy_policy_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "terms_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "webhook_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "client_type": {
            "type": "string",
            "enum": [
              "confidential",
              "public"
            ]
          },
          "client_auth": {
            "type": "string",
            "enum": [
              "private_key_jwt",
              "client_secret",
              "none"
            ]
          },
          "jwks_uri": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Required for `private_key_jwt` (APP-2)."
          },
          "verification": {
            "type": "string",
            "enum": [
              "unverified",
              "verified"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "AppCreate": {
        "type": "object",
        "properties": {
          "owner_org_id": {
            "$ref": "#/components/schemas/OrgId",
            "description": "Defaults to the acting org (APP-4)."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "homepage_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "privacy_policy_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "terms_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "webhook_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "client_type": {
            "type": "string",
            "enum": [
              "confidential",
              "public"
            ]
          },
          "client_auth": {
            "type": "string",
            "enum": [
              "private_key_jwt",
              "client_secret",
              "none"
            ]
          },
          "jwks_uri": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Required for `private_key_jwt` (APP-2)."
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "name",
          "redirect_uris",
          "client_type",
          "client_auth"
        ]
      },
      "AppUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "homepage_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "privacy_policy_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "terms_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "webhook_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "client_type": {
            "type": "string",
            "enum": [
              "confidential",
              "public"
            ]
          },
          "client_auth": {
            "type": "string",
            "enum": [
              "private_key_jwt",
              "client_secret",
              "none"
            ]
          },
          "jwks_uri": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Required for `private_key_jwt` (APP-2)."
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "minProperties": 1
      },
      "AppSecrets": {
        "type": "object",
        "required": [
          "object",
          "app",
          "client_secret",
          "webhook_secret"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "app_secrets"
          },
          "app": {
            "$ref": "#/components/schemas/App"
          },
          "client_secret": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^clp_cs_",
            "description": "Shown once; only for `client_secret` auth."
          },
          "webhook_secret": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^clp_whsec_",
            "description": "Shown once when `webhook_url` is set (EVT-18)."
          }
        }
      },
      "Installation": {
        "type": "object",
        "required": [
          "id",
          "object",
          "app_id",
          "org_id",
          "membership_id",
          "installed_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/PrincipalId",
            "description": "The installation principal (APP-23)."
          },
          "object": {
            "type": "string",
            "const": "installation"
          },
          "app_id": {
            "$ref": "#/components/schemas/AppId"
          },
          "org_id": {
            "$ref": "#/components/schemas/OrgId"
          },
          "membership_id": {
            "$ref": "#/components/schemas/MembershipId"
          },
          "installed_by": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "InstallationCreate": {
        "type": "object",
        "properties": {
          "org_id": {
            "$ref": "#/components/schemas/OrgId",
            "description": "Defaults to the acting org."
          },
          "role_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleId"
            },
            "minItems": 1
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "role_ids"
        ]
      },
      "McpAccess": {
        "type": "object",
        "required": [
          "resource",
          "permissions"
        ],
        "additionalProperties": false,
        "properties": {
          "resource": {
            "$ref": "#/components/schemas/ResourceRef"
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessLevel"
            },
            "minItems": 1,
            "uniqueItems": true
          }
        }
      },
      "McpServer": {
        "type": "object",
        "required": [
          "id",
          "object",
          "owner",
          "name",
          "created_by",
          "acts_as",
          "access",
          "url",
          "credential_id",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/McpServerId"
          },
          "object": {
            "type": "string",
            "const": "mcp_server"
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerRef"
          },
          "name": {
            "type": "string"
          },
          "created_by": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "acts_as": {
            "$ref": "#/components/schemas/PrincipalId",
            "description": "The owner, or for org-owned servers an org-controlled principal (APP-30, APP-31)."
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpAccess"
            }
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "credential_id": {
            "$ref": "#/components/schemas/CredentialId"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "McpServerCreate": {
        "type": "object",
        "properties": {
          "owner": {
            "$ref": "#/components/schemas/OwnerRef"
          },
          "name": {
            "type": "string"
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpAccess"
            },
            "minItems": 1
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "owner",
          "name",
          "access"
        ]
      },
      "McpServerUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpAccess"
            },
            "minItems": 1
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "minProperties": 1
      },
      "McpServerSecret": {
        "type": "object",
        "required": [
          "object",
          "mcp_server",
          "api_key"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "mcp_server_secret"
          },
          "mcp_server": {
            "$ref": "#/components/schemas/McpServer"
          },
          "api_key": {
            "type": "string",
            "pattern": "^clp_sk_",
            "description": "Shown once (APP-32, CORE-8)."
          }
        }
      },
      "Content": {
        "description": "Record content (MEM-4).",
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type",
              "text"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "text"
              },
              "text": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type",
              "data"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "json"
              },
              "data": {}
            }
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "Source": {
        "type": "object",
        "required": [
          "kind",
          "uri",
          "external_id"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "pattern": "^[a-z0-9_.-]+$",
            "description": "Free-form lowercase (MEM-8)."
          },
          "uri": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Item id in an external system; set by connector sync (CONN-34)."
          }
        }
      },
      "Provenance": {
        "type": "object",
        "description": "Set by the host; never supplied by clients (MEM-6).",
        "required": [
          "author_id",
          "acting_org_id",
          "app_id",
          "connector_id",
          "delegation_chain"
        ],
        "properties": {
          "author_id": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "acting_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ]
          },
          "app_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppId"
              },
              {
                "type": "null"
              }
            ]
          },
          "connector_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectorId"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set on records written by sync (CONN-34)."
          },
          "delegation_chain": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrincipalId"
            },
            "maxItems": 5
          }
        }
      },
      "Record": {
        "type": "object",
        "required": [
          "id",
          "object",
          "memory",
          "content",
          "space_ids",
          "visibility",
          "occurred_at",
          "expires_at",
          "source",
          "provenance",
          "processing",
          "metadata",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/RecordId"
          },
          "object": {
            "type": "string",
            "const": "record"
          },
          "memory": {
            "$ref": "#/components/schemas/MemoryRef"
          },
          "content": {
            "$ref": "#/components/schemas/Content"
          },
          "space_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpaceId"
            },
            "uniqueItems": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "normal",
              "private"
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Source"
              },
              {
                "type": "null"
              }
            ]
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          },
          "processing": {
            "type": "string",
            "enum": [
              "pending",
              "complete",
              "failed"
            ]
          },
          "metadata": {
            "type": "object",
            "description": "`supersedes` names a corrected record (MEM-5).",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "RecordInput": {
        "type": "object",
        "properties": {
          "content": {
            "$ref": "#/components/schemas/Content"
          },
          "space_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpaceId"
            },
            "uniqueItems": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "normal",
              "private"
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "source": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "pattern": "^[a-z0-9_.-]+$"
              },
              "uri": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri"
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            },
            "required": [
              "kind"
            ]
          },
          "metadata": {
            "type": "object",
            "description": "Free-form client metadata.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "content"
        ],
        "description": "`provenance` is host-set and rejected here (MEM-6)."
      },
      "RememberRequest": {
        "type": "object",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordInput"
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "records"
        ]
      },
      "RememberAnyRequest": {
        "type": "object",
        "properties": {
          "target": {
            "$ref": "#/components/schemas/MemoryRef",
            "description": "Omit to use the default target (MEM-19)."
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordInput"
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "records"
        ]
      },
      "RecordUpdate": {
        "type": "object",
        "properties": {
          "space_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpaceId"
            },
            "uniqueItems": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "normal",
              "private"
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Free-form client metadata.",
            "additionalProperties": true
          },
          "content": {
            "description": "Accepted by the schema only so that hosts return `content_immutable` rather than `unknown_parameter` (MEM-5).",
            "x-clp-always-rejected": "content_immutable"
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "description": "JSON Merge Patch (MEM-5).",
        "minProperties": 1
      },
      "LabelRule": {
        "type": "object",
        "description": "Deterministic label rule (MEM-12). All present conditions must match.",
        "minProperties": 1,
        "additionalProperties": false,
        "properties": {
          "app_id": {
            "$ref": "#/components/schemas/AppId"
          },
          "author_id": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "connector_id": {
            "$ref": "#/components/schemas/ConnectorId"
          },
          "source_kind": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "required": [
              "key"
            ],
            "additionalProperties": false,
            "properties": {
              "key": {
                "type": "string"
              },
              "equals": {}
            }
          }
        }
      },
      "Space": {
        "type": "object",
        "required": [
          "id",
          "object",
          "memory",
          "name",
          "description",
          "app_access",
          "label_rules",
          "suggestions",
          "record_count",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/SpaceId"
          },
          "object": {
            "type": "string",
            "const": "space"
          },
          "memory": {
            "$ref": "#/components/schemas/MemoryRef"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "app_access": {
            "type": "string",
            "enum": [
              "allowed",
              "disallowed"
            ]
          },
          "label_rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelRule"
            }
          },
          "suggestions": {
            "type": "string",
            "enum": [
              "off",
              "review",
              "auto"
            ]
          },
          "record_count": {
            "type": "integer",
            "minimum": 0
          },
          "created_by": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "SpaceCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "app_access": {
            "type": "string",
            "enum": [
              "allowed",
              "disallowed"
            ]
          },
          "label_rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelRule"
            }
          },
          "suggestions": {
            "type": "string",
            "enum": [
              "off",
              "review",
              "auto"
            ]
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "name"
        ]
      },
      "SpaceUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "app_access": {
            "type": "string",
            "enum": [
              "allowed",
              "disallowed"
            ]
          },
          "label_rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelRule"
            }
          },
          "suggestions": {
            "type": "string",
            "enum": [
              "off",
              "review",
              "auto"
            ]
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "minProperties": 1
      },
      "Suggestion": {
        "type": "object",
        "required": [
          "id",
          "object",
          "memory",
          "record_id",
          "space_id",
          "status",
          "decided_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/SuggestionId"
          },
          "object": {
            "type": "string",
            "const": "suggestion"
          },
          "memory": {
            "$ref": "#/components/schemas/MemoryRef"
          },
          "record_id": {
            "$ref": "#/components/schemas/RecordId"
          },
          "space_id": {
            "$ref": "#/components/schemas/SpaceId"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "rejected"
            ]
          },
          "decided_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrincipalId"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        },
        "description": "Queued label suggestion (MEM-32). Capability `spaces.suggestions`."
      },
      "LabelRequest": {
        "type": "object",
        "properties": {
          "record_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordId"
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "record_ids"
        ]
      },
      "LabelResult": {
        "type": "object",
        "required": [
          "object",
          "space_id",
          "record_ids"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "label_result"
          },
          "space_id": {
            "$ref": "#/components/schemas/SpaceId"
          },
          "record_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordId"
            }
          }
        }
      },
      "RecallFilters": {
        "type": "object",
        "properties": {
          "occurred_after": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "occurred_before": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "authors": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/PrincipalId"
            }
          },
          "apps": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/AppId"
            }
          },
          "source_kinds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        }
      },
      "RecallRequest": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1
          },
          "targets": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/MemoryRef"
                },
                {
                  "$ref": "#/components/schemas/SpaceRef"
                }
              ]
            },
            "minItems": 1,
            "description": "Omit for own memory plus the acting org's (MEM-23)."
          },
          "filters": {
            "$ref": "#/components/schemas/RecallFilters"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 10
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "query"
        ]
      },
      "RecallItem": {
        "description": "MEM-24.",
        "oneOf": [
          {
            "type": "object",
            "required": [
              "kind",
              "record",
              "memory",
              "score"
            ],
            "properties": {
              "kind": {
                "const": "record"
              },
              "record": {
                "$ref": "#/components/schemas/Record"
              },
              "memory": {
                "$ref": "#/components/schemas/MemoryRef"
              },
              "score": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "kind",
              "derived_type",
              "content",
              "citations",
              "memory",
              "score"
            ],
            "properties": {
              "kind": {
                "const": "derived"
              },
              "derived_type": {
                "type": "string"
              },
              "content": {
                "$ref": "#/components/schemas/Content"
              },
              "citations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RecordId"
                },
                "minItems": 1
              },
              "memory": {
                "$ref": "#/components/schemas/MemoryRef"
              },
              "score": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          }
        ],
        "discriminator": {
          "propertyName": "kind"
        }
      },
      "RecallResult": {
        "type": "object",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "recall_result"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecallItem"
            }
          }
        }
      },
      "ForgetFilter": {
        "type": "object",
        "properties": {
          "space_id": {
            "$ref": "#/components/schemas/SpaceId"
          },
          "app_id": {
            "$ref": "#/components/schemas/AppId"
          },
          "author_id": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "source_kind": {
            "type": "string"
          },
          "occurred_after": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "occurred_before": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "minProperties": 1
      },
      "ForgetRequest": {
        "description": "Forget by ids or by filter (MEM-21, APP-20).",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "memory": {
                "$ref": "#/components/schemas/MemoryRef"
              },
              "record_ids": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RecordId"
                },
                "minItems": 1,
                "maxItems": 100
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            },
            "required": [
              "memory",
              "record_ids"
            ]
          },
          {
            "type": "object",
            "properties": {
              "memory": {
                "$ref": "#/components/schemas/MemoryRef"
              },
              "filter": {
                "$ref": "#/components/schemas/ForgetFilter"
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
            },
            "required": [
              "memory",
              "filter"
            ]
          }
        ]
      },
      "ForgetResult": {
        "type": "object",
        "required": [
          "object",
          "memory",
          "forgotten_count"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "forget_result"
          },
          "memory": {
            "$ref": "#/components/schemas/MemoryRef"
          },
          "forgotten_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ExportResult": {
        "type": "object",
        "description": "`result` of a succeeded `memory.export` operation.",
        "required": [
          "format",
          "download_url",
          "expires_at"
        ],
        "properties": {
          "format": {
            "const": "jsonl"
          },
          "download_url": {
            "type": "string",
            "format": "uri"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "ExportLine": {
        "description": "One line of a JSON Lines export bundle (MEM-29, MEM-30). Labels travel as `record.space_ids`.",
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type",
              "space"
            ],
            "properties": {
              "type": {
                "const": "space"
              },
              "space": {
                "$ref": "#/components/schemas/Space"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type",
              "record"
            ],
            "properties": {
              "type": {
                "const": "record"
              },
              "record": {
                "$ref": "#/components/schemas/Record"
              }
            }
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "EventType": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "principal.created",
              "principal.established",
              "principal.updated",
              "principal.claimed",
              "principal.released",
              "principal.transferred",
              "principal.suspended",
              "principal.unsuspended",
              "principal.deleted",
              "principal.expired",
              "org.created",
              "org.updated",
              "org.policy_updated",
              "org.suspended",
              "org.deleted",
              "membership.invited",
              "membership.joined",
              "membership.declined",
              "membership.roles_updated",
              "membership.removed",
              "membership.left",
              "role.created",
              "role.updated",
              "role.deleted",
              "grant.issued",
              "grant.accepted",
              "grant.declined",
              "grant.revoked",
              "grant.expired",
              "grant.exhausted",
              "credential.created",
              "credential.rotated",
              "credential.revoked",
              "credential.leak_revoked",
              "session.refresh_reused",
              "app.registered",
              "app.updated",
              "app.deleted",
              "connection.created",
              "connection.updated",
              "connection.approved",
              "connection.revoked",
              "installation.created",
              "installation.removed",
              "mcp_server.created",
              "mcp_server.updated",
              "mcp_server.deleted",
              "record.remembered",
              "record.updated",
              "record.forgotten",
              "space.created",
              "space.updated",
              "space.deleted",
              "memory.read",
              "memory.exported",
              "memory.imported",
              "suggestion.created",
              "suggestion.accepted",
              "suggestion.rejected",
              "connector.created",
              "connector.updated",
              "connector.deleted",
              "connector.connected",
              "connector.disconnected",
              "connector.tool_changed",
              "connector.called",
              "connector.synced",
              "connector_view.created",
              "connector_view.updated",
              "connector_view.deleted",
              "operation.succeeded",
              "operation.failed"
            ]
          },
          {
            "type": "string",
            "pattern": "^x_[a-z0-9]+\\.[a-z_]+\\.[a-z_]+$"
          }
        ],
        "description": "EVT-5, EVT-6."
      },
      "Actor": {
        "type": "object",
        "required": [
          "principal_id",
          "delegation_chain",
          "app_id",
          "credential_id"
        ],
        "properties": {
          "principal_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrincipalId"
              },
              {
                "type": "null"
              }
            ],
            "description": "`null` for host-initiated changes (EVT-1)."
          },
          "delegation_chain": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrincipalId"
            },
            "maxItems": 5
          },
          "app_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppId"
              },
              {
                "type": "null"
              }
            ]
          },
          "credential_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CredentialId"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Event": {
        "type": "object",
        "description": "Immutable (EVT-3). Never contains record content or secrets (EVT-2).",
        "required": [
          "id",
          "object",
          "type",
          "occurred_at",
          "actor",
          "acting_org_id",
          "subject",
          "data",
          "request_id",
          "version"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/EventId"
          },
          "object": {
            "const": "event"
          },
          "type": {
            "$ref": "#/components/schemas/EventType"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "actor": {
            "$ref": "#/components/schemas/Actor"
          },
          "acting_org_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgId"
              },
              {
                "type": "null"
              }
            ]
          },
          "subject": {
            "type": "object",
            "required": [
              "type",
              "id"
            ],
            "properties": {
              "type": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            }
          },
          "data": {
            "type": "object",
            "description": "Type-specific. Updates carry `previous` and `current` (EVT-4)."
          },
          "request_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestId"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        }
      },
      "Webhook": {
        "type": "object",
        "required": [
          "id",
          "object",
          "owner",
          "log",
          "url",
          "event_types",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WebhookId"
          },
          "object": {
            "type": "string",
            "const": "webhook"
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerRef"
          },
          "log": {
            "$ref": "#/components/schemas/OwnerRef",
            "description": "The log watched; defaults to `owner` (EVT-14)."
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "event_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventType"
            },
            "minItems": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "WebhookCreate": {
        "type": "object",
        "properties": {
          "owner": {
            "$ref": "#/components/schemas/OwnerRef"
          },
          "log": {
            "$ref": "#/components/schemas/OwnerRef"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "event_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventType"
            },
            "minItems": 1
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "owner",
          "url",
          "event_types"
        ]
      },
      "WebhookUpdate": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "event_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventType"
            },
            "minItems": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "minProperties": 1
      },
      "WebhookSecret": {
        "type": "object",
        "required": [
          "object",
          "webhook",
          "secret"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook_secret"
          },
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          },
          "secret": {
            "type": "string",
            "pattern": "^clp_whsec_",
            "description": "Signing secret, shown once (EVT-14, CORE-34)."
          }
        }
      },
      "DiscoveryDocument": {
        "type": "object",
        "description": "DISC-1.",
        "required": [
          "issuer",
          "protocol_versions",
          "api_base_url",
          "mcp_url",
          "schema_url",
          "oauth_authorization_server",
          "openid_configuration",
          "jwks_uri",
          "establishment_policy",
          "establishment_methods",
          "pending_lifetime",
          "capabilities",
          "extensions",
          "event_retention",
          "content_types",
          "conformance"
        ],
        "properties": {
          "issuer": {
            "type": "string",
            "format": "uri"
          },
          "protocol_versions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "version",
                "status",
                "sunset_at"
              ],
              "properties": {
                "version": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "current",
                    "supported",
                    "deprecated"
                  ]
                },
                "sunset_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
                }
              }
            },
            "minItems": 1
          },
          "api_base_url": {
            "type": "string",
            "format": "uri"
          },
          "mcp_url": {
            "type": "string",
            "format": "uri"
          },
          "schema_url": {
            "type": "string",
            "format": "uri"
          },
          "oauth_authorization_server": {
            "type": "string",
            "format": "uri"
          },
          "openid_configuration": {
            "type": "string",
            "format": "uri"
          },
          "jwks_uri": {
            "type": "string",
            "format": "uri"
          },
          "establishment_policy": {
            "$ref": "#/components/schemas/EstablishmentPolicy"
          },
          "establishment_methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EstablishmentMethod"
            }
          },
          "pending_lifetime": {
            "type": "string",
            "description": "ISO 8601 duration (DISC-3).",
            "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "extensions": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^x_[a-z0-9]+$"
            }
          },
          "event_retention": {
            "type": "string",
            "description": "At least P90D (EVT-11).",
            "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$"
          },
          "content_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "json"
              ]
            }
          },
          "conformance": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "core",
                "apps",
                "events",
                "connectors"
              ]
            }
          }
        }
      },
      "ConnectorProvider": {
        "description": "CONN-2.",
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type",
              "key",
              "url"
            ],
            "properties": {
              "type": {
                "const": "native"
              },
              "key": {
                "type": "string",
                "pattern": "^[a-z0-9_]+$"
              },
              "url": {
                "type": "null"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type",
              "key",
              "url"
            ],
            "properties": {
              "type": {
                "const": "mcp"
              },
              "key": {
                "type": "null"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "ConnectorAccount": {
        "type": "object",
        "description": "Linked external account (CONN-6). Credentials are never included (CONN-8).",
        "required": [
          "status",
          "label",
          "connected_by",
          "connected_at"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "not_connected",
              "connected",
              "expired",
              "revoked"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "connected_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrincipalId"
              },
              {
                "type": "null"
              }
            ]
          },
          "connected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "ConnectorTool": {
        "type": "object",
        "description": "CONN-15 to CONN-18.",
        "required": [
          "name",
          "kind",
          "description",
          "input_schema",
          "status",
          "definition_hash"
        ],
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,48}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "read",
              "action"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "input_schema": {
            "type": "object"
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled",
              "needs_review"
            ]
          },
          "definition_hash": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]+$"
          }
        }
      },
      "ConnectorSync": {
        "type": "object",
        "description": "One-way sync into the owner's memory (CONN-31 to CONN-35).",
        "required": [
          "enabled",
          "target",
          "space_ids",
          "filter",
          "visibility",
          "on_source_delete",
          "on_remove",
          "status",
          "last_synced_at"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "target": {
            "$ref": "#/components/schemas/MemoryRef"
          },
          "space_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpaceId"
            },
            "uniqueItems": true
          },
          "filter": {
            "type": "object",
            "description": "Provider-specific (catalog sync filter schema)."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "normal",
              "private"
            ]
          },
          "on_source_delete": {
            "type": "string",
            "enum": [
              "forget",
              "keep"
            ]
          },
          "on_remove": {
            "type": "string",
            "enum": [
              "keep",
              "forget"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "paused",
              "error"
            ]
          },
          "last_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        }
      },
      "Connector": {
        "type": "object",
        "required": [
          "id",
          "object",
          "owner",
          "name",
          "description",
          "provider",
          "config",
          "account",
          "tools",
          "sync",
          "acts_as",
          "status",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ConnectorId"
          },
          "object": {
            "type": "string",
            "const": "connector"
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerRef"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider": {
            "$ref": "#/components/schemas/ConnectorProvider"
          },
          "config": {
            "type": "object",
            "description": "Provider-specific, non-secret (CONN-2)."
          },
          "account": {
            "$ref": "#/components/schemas/ConnectorAccount"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConnectorTool"
            }
          },
          "sync": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectorSync"
              },
              {
                "type": "null"
              }
            ]
          },
          "acts_as": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrincipalId"
              },
              {
                "type": "null"
              }
            ],
            "description": "Syncing principal of an org-owned connector (CONN-33)."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled",
              "error"
            ]
          },
          "created_by": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        },
        "description": "CONN-1. A grantee of a view sees only `id`, `name`, `provider` and the tools in its views (CONN-25)."
      },
      "ConnectorCreate": {
        "type": "object",
        "properties": {
          "owner": {
            "$ref": "#/components/schemas/OwnerRef"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "provider": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "native"
                  },
                  "key": {
                    "type": "string",
                    "pattern": "^[a-z0-9_]+$"
                  }
                },
                "additionalProperties": false,
                "patternProperties": {
                  "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
                },
                "required": [
                  "type",
                  "key"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "mcp"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "additionalProperties": false,
                "patternProperties": {
                  "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
                },
                "required": [
                  "type",
                  "url"
                ]
              }
            ]
          },
          "config": {
            "type": "object"
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "owner",
          "name",
          "provider"
        ]
      },
      "ConnectorSyncInput": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "target": {
            "$ref": "#/components/schemas/MemoryRef"
          },
          "space_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpaceId"
            },
            "uniqueItems": true
          },
          "filter": {
            "type": "object",
            "description": "Provider-specific (catalog sync filter schema)."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "normal",
              "private"
            ]
          },
          "on_source_delete": {
            "type": "string",
            "enum": [
              "forget",
              "keep"
            ]
          },
          "on_remove": {
            "type": "string",
            "enum": [
              "keep",
              "forget"
            ]
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "description": "CONN-35. Requires `memory:write` on the target."
      },
      "ConnectorUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "config": {
            "type": "object"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "sync": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectorSyncInput"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "minProperties": 1
      },
      "ConnectRequest": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "oauth",
              "secret",
              "none"
            ]
          },
          "secret": {
            "type": "string",
            "writeOnly": true,
            "description": "For `secret`; stored by the host and never returned (CONN-7, CONN-8)."
          },
          "redirect_uri": {
            "type": "string",
            "format": "uri",
            "description": "For `oauth`: where to return after provider consent."
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "method"
        ]
      },
      "ConnectResult": {
        "type": "object",
        "required": [
          "object",
          "connector",
          "authorization_url"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "connect_result"
          },
          "connector": {
            "$ref": "#/components/schemas/Connector"
          },
          "authorization_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "For `oauth`: send the principal here (CONN-7)."
          }
        }
      },
      "ToolUpdate": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "read",
              "action"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "description": "CONN-17, CONN-18.",
        "minProperties": 1
      },
      "ToolCallRequest": {
        "type": "object",
        "properties": {
          "view_id": {
            "$ref": "#/components/schemas/ConnectorViewId",
            "description": "Access path; omit to call through the whole connector (CONN-11)."
          },
          "arguments": {
            "type": "object"
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "arguments"
        ]
      },
      "ToolResult": {
        "type": "object",
        "description": "MCP tool result shape (CONN-12).",
        "required": [
          "object",
          "connector_id",
          "view_id",
          "tool",
          "content",
          "structured_content",
          "is_error"
        ],
        "properties": {
          "object": {
            "const": "tool_result"
          },
          "connector_id": {
            "$ref": "#/components/schemas/ConnectorId"
          },
          "view_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectorViewId"
              },
              {
                "type": "null"
              }
            ]
          },
          "tool": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,48}$"
          },
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type"
              ],
              "properties": {
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "structured_content": {
            "type": [
              "object",
              "null"
            ]
          },
          "is_error": {
            "type": "boolean"
          }
        }
      },
      "ViewConstraints": {
        "type": "object",
        "description": "CONN-20.",
        "additionalProperties": false,
        "properties": {
          "arguments": {
            "type": "object",
            "description": "Per tool name, a JSON Schema the arguments must also satisfy.",
            "additionalProperties": {
              "type": "object"
            }
          },
          "provider": {
            "type": "object",
            "description": "Native providers only; valid against the catalog constraint schema."
          },
          "rate_limit": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "calls",
              "per"
            ],
            "additionalProperties": false,
            "properties": {
              "calls": {
                "type": "integer",
                "minimum": 1
              },
              "per": {
                "type": "string",
                "description": "ISO 8601 duration (DISC-3).",
                "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$"
              }
            }
          }
        }
      },
      "ConnectorView": {
        "type": "object",
        "required": [
          "id",
          "object",
          "connector_id",
          "name",
          "description",
          "tools",
          "constraints",
          "app_access",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ConnectorViewId"
          },
          "object": {
            "type": "string",
            "const": "connector_view"
          },
          "connector_id": {
            "$ref": "#/components/schemas/ConnectorId"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9_]{1,48}$"
            },
            "uniqueItems": true
          },
          "constraints": {
            "$ref": "#/components/schemas/ViewConstraints"
          },
          "app_access": {
            "type": "string",
            "enum": [
              "allowed",
              "disallowed"
            ]
          },
          "created_by": {
            "$ref": "#/components/schemas/PrincipalId"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339, UTC, millisecond precision (CORE-17)."
          }
        },
        "description": "CONN-19."
      },
      "ConnectorViewCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9_]{1,48}$"
            },
            "uniqueItems": true
          },
          "constraints": {
            "$ref": "#/components/schemas/ViewConstraints"
          },
          "app_access": {
            "type": "string",
            "enum": [
              "allowed",
              "disallowed"
            ]
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "required": [
          "name",
          "tools"
        ]
      },
      "ConnectorViewUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9_]{1,48}$"
            },
            "uniqueItems": true
          },
          "constraints": {
            "$ref": "#/components/schemas/ViewConstraints"
          },
          "app_access": {
            "type": "string",
            "enum": [
              "allowed",
              "disallowed"
            ]
          }
        },
        "additionalProperties": false,
        "patternProperties": {
          "^x_[a-z0-9]+(_[a-z0-9]+)*$": {}
        },
        "minProperties": 1
      },
      "ConnectorType": {
        "type": "object",
        "description": "Catalog entry for a native provider (CONN-40).",
        "required": [
          "object",
          "key",
          "name",
          "auth",
          "tools",
          "config_schema",
          "constraint_schema",
          "sync"
        ],
        "properties": {
          "object": {
            "const": "connector_type"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "auth": {
            "type": "string",
            "enum": [
              "oauth",
              "secret",
              "none"
            ]
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "kind",
                "input_schema"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z0-9_]{1,48}$"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "read",
                    "action"
                  ]
                },
                "input_schema": {
                  "type": "object"
                }
              }
            }
          },
          "config_schema": {
            "type": "object"
          },
          "constraint_schema": {
            "type": "object"
          },
          "sync": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "filter_schema"
            ],
            "properties": {
              "filter_schema": {
                "type": "object"
              }
            }
          }
        }
      },
      "PrincipalList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Principal"
                }
              }
            }
          }
        ]
      },
      "OrgList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Org"
                }
              }
            }
          }
        ]
      },
      "MembershipList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          }
        ]
      },
      "RoleList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            }
          }
        ]
      },
      "GrantList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Grant"
                }
              }
            }
          }
        ]
      },
      "CredentialList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            }
          }
        ]
      },
      "AppList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/App"
                }
              }
            }
          }
        ]
      },
      "InstallationList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Installation"
                }
              }
            }
          }
        ]
      },
      "McpServerList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/McpServer"
                }
              }
            }
          }
        ]
      },
      "RecordList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          }
        ]
      },
      "SpaceList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Space"
                }
              }
            }
          }
        ]
      },
      "EventList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          }
        ]
      },
      "WebhookList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          }
        ]
      },
      "SuggestionList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Suggestion"
                }
              }
            }
          }
        ]
      },
      "ConnectorList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Connector"
                }
              }
            }
          }
        ]
      },
      "ConnectorViewList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            }
          }
        ]
      },
      "ConnectorTypeList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ConnectorType"
                }
              }
            }
          }
        ]
      }
    },
    "parameters": {
      "principal_id": {
        "name": "principal_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/PrincipalId"
        }
      },
      "org_id": {
        "name": "org_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/OrgId"
        }
      },
      "membership_id": {
        "name": "membership_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/MembershipId"
        }
      },
      "role_id": {
        "name": "role_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/RoleId"
        }
      },
      "grant_id": {
        "name": "grant_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/GrantId"
        }
      },
      "credential_id": {
        "name": "credential_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/CredentialId"
        }
      },
      "app_id": {
        "name": "app_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/AppId"
        }
      },
      "mcp_id": {
        "name": "mcp_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/McpServerId"
        }
      },
      "space_id": {
        "name": "space_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/SpaceId"
        }
      },
      "record_id": {
        "name": "record_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/RecordId"
        }
      },
      "event_id": {
        "name": "event_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/EventId"
        }
      },
      "operation_id": {
        "name": "operation_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/OperationId"
        }
      },
      "webhook_id": {
        "name": "webhook_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/WebhookId"
        }
      },
      "owner_id": {
        "name": "owner_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/OwnerId"
        },
        "description": "Owner of the memory (MEM-1)."
      },
      "installation_id": {
        "name": "installation_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/PrincipalId"
        },
        "description": "The installation principal's id (APP-23)."
      },
      "suggestion_id": {
        "name": "suggestion_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/SuggestionId"
        }
      },
      "connector_id": {
        "name": "connector_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/ConnectorId"
        }
      },
      "view_id": {
        "name": "view_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/ConnectorViewId"
        }
      },
      "tool": {
        "name": "tool",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[a-z0-9_]{1,48}$"
        }
      },
      "CLP-Version": {
        "name": "CLP-Version",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "example": "2026-12-01"
        },
        "description": "Protocol version (CORE-10)."
      },
      "CLP-Org": {
        "name": "CLP-Org",
        "in": "header",
        "required": false,
        "schema": {
          "anyOf": [
            {
              "$ref": "#/components/schemas/OrgId"
            },
            {
              "const": "personal"
            }
          ]
        },
        "description": "Acting org, or `personal` (ORG-35). Ignored when the credential is bound."
      },
      "Idempotency-Key": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 255
        },
        "description": "Safe retries (CORE-26)."
      },
      "DPoP": {
        "name": "DPoP",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "DPoP proof (CRED-12, RFC 9449)."
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 20
        }
      },
      "cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Opaque (CORE-25)."
      }
    },
    "headers": {
      "CLP-Request-Id": {
        "schema": {
          "$ref": "#/components/schemas/RequestId"
        },
        "description": "Equals `request_id` in errors (BIND-6)."
      },
      "RateLimit": {
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Policy": {
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "schema": {
          "type": "string"
        },
        "description": "After `rate_limited` or 503."
      },
      "Deprecation": {
        "schema": {
          "type": "string"
        },
        "description": "Deprecated version in use (DISC-6)."
      },
      "Sunset": {
        "schema": {
          "type": "string"
        },
        "description": "Sunset date of the version in use (DISC-6)."
      }
    },
    "responses": {
      "Problem4XX": {
        "description": "Client error. `code` maps to one status per x-clp-error-codes (BIND-7).",
        "headers": {
          "CLP-Request-Id": {
            "$ref": "#/components/headers/CLP-Request-Id"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "Deprecation": {
            "$ref": "#/components/headers/Deprecation"
          },
          "Sunset": {
            "$ref": "#/components/headers/Sunset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Problem5XX": {
        "description": "Server error.",
        "headers": {
          "CLP-Request-Id": {
            "$ref": "#/components/headers/CLP-Request-Id"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "Deprecation": {
            "$ref": "#/components/headers/Deprecation"
          },
          "Sunset": {
            "$ref": "#/components/headers/Sunset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Access token (`clp_at_`) or API key (`clp_sk_`) (CRED-10)."
      },
      "dpop": {
        "type": "http",
        "scheme": "DPoP",
        "description": "DPoP-bound access token (CRED-12)."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "Apps (Module 5). Device code, jwt-bearer, email-otp and token exchange are not expressible as OpenAPI flows; RFC 8414 metadata is authoritative (BIND-22).",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "/oauth/authorize",
            "tokenUrl": "/oauth/token",
            "refreshUrl": "/oauth/token",
            "scopes": {
              "memory:read": "Read memory the principal selects",
              "memory:write": "Write memory",
              "openid": "Sign in",
              "profile": "Profile claims",
              "email": "Email claims"
            }
          },
          "clientCredentials": {
            "tokenUrl": "/oauth/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "x-clp-error-codes": {
    "invalid_request": {
      "status": 400,
      "modules": [
        "core"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/invalid_request"
    },
    "unknown_parameter": {
      "status": 400,
      "modules": [
        "core"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/unknown_parameter"
    },
    "unsupported_version": {
      "status": 400,
      "modules": [
        "core"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/unsupported_version"
    },
    "unauthenticated": {
      "status": 401,
      "modules": [
        "core"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/unauthenticated"
    },
    "permission_denied": {
      "status": 403,
      "modules": [
        "core",
        "authorization"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/permission_denied"
    },
    "not_found": {
      "status": 404,
      "modules": [
        "core"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/not_found"
    },
    "conflict": {
      "status": 409,
      "modules": [
        "core"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/conflict"
    },
    "idempotency_conflict": {
      "status": 409,
      "modules": [
        "core"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/idempotency_conflict"
    },
    "rate_limited": {
      "status": 429,
      "modules": [
        "core"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/rate_limited"
    },
    "internal_error": {
      "status": 500,
      "modules": [
        "core"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/internal_error"
    },
    "principal_pending": {
      "status": 403,
      "modules": [
        "identity"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/principal_pending"
    },
    "principal_suspended": {
      "status": 403,
      "modules": [
        "identity"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/principal_suspended"
    },
    "email_not_verified": {
      "status": 403,
      "modules": [
        "identity"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/email_not_verified"
    },
    "claim_code_used": {
      "status": 409,
      "modules": [
        "identity"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/claim_code_used"
    },
    "already_controlled": {
      "status": 409,
      "modules": [
        "identity"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/already_controlled"
    },
    "handle_taken": {
      "status": 409,
      "modules": [
        "identity"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/handle_taken"
    },
    "last_owner": {
      "status": 409,
      "modules": [
        "identity",
        "orgs"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/last_owner"
    },
    "claim_code_invalid": {
      "status": 400,
      "modules": [
        "identity"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/claim_code_invalid"
    },
    "not_a_member": {
      "status": 403,
      "modules": [
        "orgs"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/not_a_member"
    },
    "admission_denied": {
      "status": 403,
      "modules": [
        "orgs"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/admission_denied"
    },
    "join_blocked": {
      "status": 403,
      "modules": [
        "orgs"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/join_blocked"
    },
    "org_suspended": {
      "status": 403,
      "modules": [
        "orgs"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/org_suspended"
    },
    "policy_violation": {
      "status": 403,
      "modules": [
        "orgs",
        "authorization"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/policy_violation"
    },
    "membership_exists": {
      "status": 409,
      "modules": [
        "orgs"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/membership_exists"
    },
    "invitation_expired": {
      "status": 409,
      "modules": [
        "orgs"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/invitation_expired"
    },
    "not_controlled": {
      "status": 409,
      "modules": [
        "orgs"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/not_controlled"
    },
    "controlled_membership_locked": {
      "status": 409,
      "modules": [
        "orgs"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/controlled_membership_locked"
    },
    "escalation_denied": {
      "status": 403,
      "modules": [
        "authorization"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/escalation_denied"
    },
    "grant_expired": {
      "status": 403,
      "modules": [
        "authorization"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/grant_expired"
    },
    "grant_exhausted": {
      "status": 403,
      "modules": [
        "authorization"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/grant_exhausted"
    },
    "grant_revoked": {
      "status": 403,
      "modules": [
        "authorization"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/grant_revoked"
    },
    "external_sharing_disallowed": {
      "status": 403,
      "modules": [
        "authorization"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/external_sharing_disallowed"
    },
    "grant_pending": {
      "status": 409,
      "modules": [
        "authorization"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/grant_pending"
    },
    "invalid_token": {
      "status": 401,
      "modules": [
        "credentials"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/invalid_token"
    },
    "token_expired": {
      "status": 401,
      "modules": [
        "credentials"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/token_expired"
    },
    "credential_revoked": {
      "status": 401,
      "modules": [
        "credentials"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/credential_revoked"
    },
    "dpop_required": {
      "status": 401,
      "modules": [
        "credentials"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/dpop_required"
    },
    "invalid_grant": {
      "status": 400,
      "modules": [
        "credentials"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/invalid_grant"
    },
    "refresh_token_reused": {
      "status": 400,
      "modules": [
        "credentials"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/refresh_token_reused"
    },
    "delegation_depth_exceeded": {
      "status": 400,
      "modules": [
        "credentials"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/delegation_depth_exceeded"
    },
    "credential_restriction": {
      "status": 403,
      "modules": [
        "credentials"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/credential_restriction"
    },
    "app_suspended": {
      "status": 403,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/app_suspended"
    },
    "consent_required": {
      "status": 403,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/consent_required"
    },
    "connection_pending_approval": {
      "status": 403,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/connection_pending_approval"
    },
    "connections_blocked": {
      "status": 403,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/connections_blocked"
    },
    "app_not_allowed": {
      "status": 403,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/app_not_allowed"
    },
    "app_memory_access_disallowed": {
      "status": 403,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/app_memory_access_disallowed"
    },
    "invalid_client": {
      "status": 401,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/invalid_client"
    },
    "invalid_redirect_uri": {
      "status": 400,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/invalid_redirect_uri"
    },
    "installation_not_found": {
      "status": 404,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/installation_not_found"
    },
    "mcp_server_not_found": {
      "status": 404,
      "modules": [
        "apps"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/mcp_server_not_found"
    },
    "record_not_found": {
      "status": 404,
      "modules": [
        "memory"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/record_not_found"
    },
    "space_not_found": {
      "status": 404,
      "modules": [
        "memory"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/space_not_found"
    },
    "content_immutable": {
      "status": 409,
      "modules": [
        "memory"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/content_immutable"
    },
    "target_not_allowed": {
      "status": 403,
      "modules": [
        "memory"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/target_not_allowed"
    },
    "import_invalid": {
      "status": 400,
      "modules": [
        "memory"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/import_invalid"
    },
    "webhook_url_invalid": {
      "status": 400,
      "modules": [
        "events"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/webhook_url_invalid"
    },
    "log_not_readable": {
      "status": 403,
      "modules": [
        "events"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/log_not_readable"
    },
    "connector_not_found": {
      "status": 404,
      "modules": [
        "connectors"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/connector_not_found"
    },
    "connector_auth_expired": {
      "status": 409,
      "modules": [
        "connectors"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/connector_auth_expired"
    },
    "connector_unavailable": {
      "status": 502,
      "modules": [
        "connectors"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/connector_unavailable"
    },
    "tool_not_allowed": {
      "status": 403,
      "modules": [
        "connectors"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/tool_not_allowed"
    },
    "constraint_violation": {
      "status": 403,
      "modules": [
        "connectors"
      ],
      "type": "https://contextlayerprotocol.gdrl.dev/errors/constraint_violation"
    }
  },
  "x-clp-standard-permissions": [
    "org:read",
    "org:write",
    "org:delete",
    "org:policy.write",
    "members:read",
    "members:invite",
    "members:write",
    "members:remove",
    "roles:read",
    "roles:write",
    "grants:accept",
    "billing:read",
    "billing:write",
    "audit:read",
    "principals:claim",
    "principals:create",
    "principals:transfer",
    "principals:release",
    "principals:write",
    "principals:credentials",
    "principals:suspend",
    "principals:delete",
    "principals:audit.read",
    "principals:memory",
    "apps:read",
    "apps:write",
    "apps:install",
    "apps:approve",
    "mcp:read",
    "mcp:write",
    "memory:read",
    "memory:read.private",
    "memory:write",
    "memory:forget",
    "spaces:read",
    "spaces:write",
    "spaces:share",
    "connectors:read",
    "connectors:use",
    "connectors:act",
    "connectors:write",
    "connectors:share",
    "principals:connectors"
  ],
  "x-clp-event-types": [
    "principal.created",
    "principal.established",
    "principal.updated",
    "principal.claimed",
    "principal.released",
    "principal.transferred",
    "principal.suspended",
    "principal.unsuspended",
    "principal.deleted",
    "principal.expired",
    "org.created",
    "org.updated",
    "org.policy_updated",
    "org.suspended",
    "org.deleted",
    "membership.invited",
    "membership.joined",
    "membership.declined",
    "membership.roles_updated",
    "membership.removed",
    "membership.left",
    "role.created",
    "role.updated",
    "role.deleted",
    "grant.issued",
    "grant.accepted",
    "grant.declined",
    "grant.revoked",
    "grant.expired",
    "grant.exhausted",
    "credential.created",
    "credential.rotated",
    "credential.revoked",
    "credential.leak_revoked",
    "session.refresh_reused",
    "app.registered",
    "app.updated",
    "app.deleted",
    "connection.created",
    "connection.updated",
    "connection.approved",
    "connection.revoked",
    "installation.created",
    "installation.removed",
    "mcp_server.created",
    "mcp_server.updated",
    "mcp_server.deleted",
    "record.remembered",
    "record.updated",
    "record.forgotten",
    "space.created",
    "space.updated",
    "space.deleted",
    "memory.read",
    "memory.exported",
    "memory.imported",
    "suggestion.created",
    "suggestion.accepted",
    "suggestion.rejected",
    "connector.created",
    "connector.updated",
    "connector.deleted",
    "connector.connected",
    "connector.disconnected",
    "connector.tool_changed",
    "connector.called",
    "connector.synced",
    "connector_view.created",
    "connector_view.updated",
    "connector_view.deleted",
    "operation.succeeded",
    "operation.failed"
  ]
}
