{
  "openapi": "3.1.0",
  "info": {
    "title": "Company platform API",
    "version": "1.0.0",
    "description": "Shared company API. Supabase owns company data and automation state; source providers retain their authoritative fields. Runtime observations are not a second master. Generic JSON results indicate backend-specific envelopes that callers must narrow; no fabricated DTO guarantee."
  },
  "security": [
    {
      "companyBearer": []
    }
  ],
  "paths": {
    "/v1/capabilities": {
      "get": {
        "operationId": "capabilities",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Caller-scoped capability observations; installed is not qualified",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "contract",
                    "checked_at",
                    "ready",
                    "capabilities"
                  ],
                  "properties": {
                    "contract": {
                      "const": "company-platform/1"
                    },
                    "checked_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "ready": {
                      "type": "boolean"
                    },
                    "capabilities": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "available",
                              "forbidden",
                              "unavailable",
                              "installed_unprobed"
                            ]
                          },
                          "checked": {
                            "const": "query"
                          },
                          "reason": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/session": {
      "get": {
        "operationId": "authSession",
        "description": "",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "listProjects",
        "description": "",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projects": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "projects",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/overview": {
      "get": {
        "operationId": "projectOverview",
        "description": "",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectSummary"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "from": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "to": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "projects",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{project_id}/overview": {
      "get": {
        "operationId": "projectDetail",
        "description": "",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "project": {
                      "$ref": "#/components/schemas/ProjectSummary"
                    },
                    "from": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "to": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "project"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{project_id}/spend": {
      "get": {
        "operationId": "projectSpend",
        "description": "",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "user",
                "service",
                "user,service"
              ]
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "groups": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CostGroup"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "freshness": {
                      "$ref": "#/components/schemas/Freshness"
                    },
                    "amount_basis": {
                      "const": "minor_units"
                    },
                    "include_descendants": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "groups",
                    "next_cursor",
                    "freshness",
                    "amount_basis",
                    "include_descendants"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{project_id}/agents": {
      "get": {
        "operationId": "projectAgents",
        "description": "",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "presence",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "active",
                "idle",
                "disconnected"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "agents",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{project_id}/activity": {
      "get": {
        "operationId": "projectActivity",
        "description": "",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "events",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{project_id}/external-links": {
      "get": {
        "operationId": "projectLinks",
        "description": "",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "links": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExternalLink"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sources": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "links",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/collections": {
      "get": {
        "operationId": "crmCollections",
        "description": "",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "collections"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/contacts": {
      "get": {
        "operationId": "listContacts",
        "description": "",
        "parameters": [
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "records": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Contact"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "records",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createContact",
        "description": "",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/Contact"
                    }
                  },
                  "required": [
                    "record"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/contacts/{record_id}": {
      "get": {
        "operationId": "getContact",
        "description": "",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/Contact"
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "notes_limit": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "record",
                    "notes"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateContact",
        "description": "",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/Contact"
                    }
                  },
                  "required": [
                    "record"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/contacts/{record_id}/notes": {
      "post": {
        "operationId": "addContactNote",
        "description": "",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "note": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "note"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/companies": {
      "get": {
        "operationId": "listCompanies",
        "description": "",
        "parameters": [
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "records": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Company"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "records",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createCompany",
        "description": "",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/Company"
                    }
                  },
                  "required": [
                    "record"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/companies/{record_id}": {
      "get": {
        "operationId": "getCompany",
        "description": "",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/Company"
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "notes_limit": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "record",
                    "notes"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateCompany",
        "description": "",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/Company"
                    }
                  },
                  "required": [
                    "record"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/companies/{record_id}/notes": {
      "post": {
        "operationId": "addCompanyNote",
        "description": "",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "note": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "note"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/automations": {
      "get": {
        "operationId": "listAutomations",
        "description": "",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAutomation",
        "description": "",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/automations/{automation_id}": {
      "get": {
        "operationId": "getAutomation",
        "description": "",
        "parameters": [
          {
            "name": "automation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "pauseAutomation",
        "description": "",
        "parameters": [
          {
            "name": "automation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "paused": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "paused"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/automations/{automation_id}/versions": {
      "get": {
        "operationId": "listAutomationVersions",
        "description": "",
        "parameters": [
          {
            "name": "automation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "uploadAutomationVersion",
        "description": "",
        "parameters": [
          {
            "name": "automation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "maxLength": 1000000,
                    "minLength": 1
                  },
                  "manifest": {
                    "$ref": "#/components/schemas/Manifest"
                  }
                },
                "required": [
                  "source",
                  "manifest"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreparedVersion"
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/automations/{automation_id}/activation": {
      "post": {
        "operationId": "activateAutomation",
        "description": "",
        "parameters": [
          {
            "name": "automation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "version_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/automations/{automation_id}/triggers": {
      "put": {
        "operationId": "setAutomationTrigger",
        "description": "",
        "parameters": [
          {
            "name": "automation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Trigger"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/automations/{automation_id}/runs": {
      "get": {
        "operationId": "listAutomationRuns",
        "description": "",
        "parameters": [
          {
            "name": "automation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "runAutomation",
        "description": "",
        "parameters": [
          {
            "name": "automation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/automations/{automation_id}/events": {
      "post": {
        "operationId": "emitAutomationEvent",
        "description": "",
        "parameters": [
          {
            "name": "automation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_key": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 200
                  },
                  "event_type": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "input": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "depth": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 7
                  },
                  "ancestors": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 7
                  }
                },
                "required": [
                  "event_key",
                  "event_type"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/automation-runs/{run_id}": {
      "get": {
        "operationId": "getAutomationRun",
        "description": "",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,19}$",
              "description": "Opaque decimal action sequence cursor bounded by server bigint range."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/automation-runs/{run_id}/retry": {
      "post": {
        "operationId": "retryAutomationRun",
        "description": "",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit failure; reconcile unknown mutation outcomes before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/me": {
      "get": {
        "operationId": "explorerMe",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/collections": {
      "get": {
        "operationId": "explorerCollections",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExplorerCollection"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/collections/{collection_id}/people": {
      "get": {
        "operationId": "explorerCollectionPeople",
        "parameters": [
          {
            "name": "collection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "group",
            "in": "query",
            "schema": {
              "enum": [
                "company",
                "stage",
                "none"
              ]
            },
            "required": false
          },
          {
            "name": "stage",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "priority",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExplorerPerson"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/collections/{collection_id}/companies": {
      "get": {
        "operationId": "explorerCollectionCompanies",
        "parameters": [
          {
            "name": "collection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExplorerCompany"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/collections/{collection_id}/interactions": {
      "get": {
        "operationId": "explorerCollectionInteractions",
        "parameters": [
          {
            "name": "collection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExplorerInteraction"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/contacts/{record_id}": {
      "get": {
        "operationId": "explorerContact",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/contacts/{record_id}/interactions": {
      "get": {
        "operationId": "explorerContactInteractions",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExplorerInteraction"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/contacts/{record_id}/filings": {
      "get": {
        "operationId": "explorerContactFilings",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/contacts/{record_id}/affiliations": {
      "get": {
        "operationId": "explorerContactAffiliations",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/companies/{record_id}": {
      "get": {
        "operationId": "explorerCompany",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/companies/{record_id}/interactions": {
      "get": {
        "operationId": "explorerCompanyInteractions",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExplorerInteraction"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/companies/{record_id}/filings": {
      "get": {
        "operationId": "explorerCompanyFilings",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/companies/{record_id}/people": {
      "get": {
        "operationId": "explorerCompanyPeople",
        "parameters": [
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/review": {
      "get": {
        "operationId": "explorerReview",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExplorerReviewItem"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/review/{review_id}": {
      "get": {
        "operationId": "explorerReviewItem",
        "parameters": [
          {
            "name": "review_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "explorerClassifyReview",
        "parameters": [
          {
            "name": "review_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_updated_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "status": {
                    "enum": [
                      "unclassified",
                      "needs_information",
                      "needs_merge",
                      "ready_for_review",
                      "classified",
                      "dismissed"
                    ]
                  },
                  "collection_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "expected_updated_at",
                  "status"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audited classification update",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "status": {
                          "type": "string"
                        },
                        "collection_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid"
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "collection_id",
                        "updated_at"
                      ],
                      "additionalProperties": true
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/projects/tree": {
      "get": {
        "operationId": "explorerProjectTree",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "parent_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          },
          {
            "name": "depth",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8
            },
            "required": false
          },
          {
            "name": "include_fixtures",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "required": false
          },
          {
            "name": "include_unreviewed",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CanonicalProject"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/projects/{project_id}": {
      "get": {
        "operationId": "explorerProject",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CanonicalProject"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "explorerUpdateProject",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HierarchyUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audited canonical project/mapping mutation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CanonicalProject"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/projects/{project_id}/resources": {
      "get": {
        "operationId": "explorerProjectResources",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectResource"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "explorerProposeResource",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourcePropose"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audited canonical project/mapping mutation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/ProjectResource"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/projects/{project_id}/spend": {
      "get": {
        "operationId": "explorerProjectSpend",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "rollup",
            "in": "query",
            "schema": {
              "enum": [
                "self",
                "descendants"
              ]
            },
            "required": false
          },
          {
            "name": "currency",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            },
            "required": false
          },
          {
            "name": "group_by",
            "in": "query",
            "schema": {
              "enum": [
                "user",
                "service",
                "user,service"
              ]
            },
            "required": false
          },
          {
            "name": "group_cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048,
              "description": "Opaque breakdown-group cursor independent of the expense line-item cursor."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/FinanceSpend"
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/finance/expenses": {
      "get": {
        "operationId": "explorerFinanceExpenses",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "vendor_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          },
          {
            "name": "currency",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "subscription_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/finance/subscriptions": {
      "get": {
        "operationId": "explorerFinanceSubscriptions",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/finance/usage": {
      "get": {
        "operationId": "explorerFinanceUsage",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          },
          {
            "name": "agent_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          },
          {
            "name": "model",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "currency",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/finance/unallocated": {
      "get": {
        "operationId": "explorerFinanceUnallocated",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/finance/budgets": {
      "get": {
        "operationId": "explorerFinanceBudgets",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$",
              "description": "UTC calendar month YYYY-MM"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/vendor.put": {
      "post": {
        "operationId": "financePutVendor",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financePutVendorInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financePutVendorRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/account.put": {
      "post": {
        "operationId": "financePutAccount",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financePutAccountInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financePutAccountRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/document.put": {
      "post": {
        "operationId": "financePutDocument",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financePutDocumentInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financePutDocumentRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/invoice.put": {
      "post": {
        "operationId": "financePutInvoice",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financePutInvoiceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financePutInvoiceRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/subscription.put": {
      "post": {
        "operationId": "financePutSubscription",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financePutSubscriptionInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financePutSubscriptionRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/resource.register": {
      "post": {
        "operationId": "financeRegisterResource",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financeRegisterResourceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financeRegisterResourceRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/resource.update": {
      "post": {
        "operationId": "financeUpdateResource",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financeUpdateResourceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financeUpdateResourceRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/expense.record": {
      "post": {
        "operationId": "financeRecordExpense",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financeRecordExpenseInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financeRecordExpenseRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/expense.allocate": {
      "post": {
        "operationId": "financeAllocateExpense",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financeAllocateExpenseInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financeAllocateExpenseRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/usage.record": {
      "post": {
        "operationId": "financeRecordUsage",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financeRecordUsageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financeRecordUsageRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/usage.settlement": {
      "post": {
        "operationId": "financeSettleUsage",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financeSettleUsageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financeSettleUsageRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/rate.put": {
      "post": {
        "operationId": "financePutRate",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financePutRateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financePutRateRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/budget.put": {
      "post": {
        "operationId": "financePutBudget",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financePutBudgetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financePutBudgetRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/ingestion.grant": {
      "post": {
        "operationId": "financeGrantIngestion",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financeGrantIngestionInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-authorized explorer.v1 response; unknown financial coverage is not zero.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financeGrantIngestionRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Explicit error and mutation outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/projects": {
      "post": {
        "operationId": "explorerCreateProject",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HierarchyCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audited canonical project/mapping mutation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CanonicalProject"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/projects/{project_id}/resources/{mapping_id}": {
      "patch": {
        "operationId": "explorerReviewResource",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "mapping_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourceReview"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audited canonical project/mapping mutation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/ProjectResource"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/finance/resources": {
      "get": {
        "operationId": "explorerFinanceResources",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "vendor_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized paid resources; source IDs preserved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FinanceRecord"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/actions/usage.revalue": {
      "post": {
        "operationId": "financeRevalueUsage",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/financeRevalueUsageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audited valuation correction of the existing source usage record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/financeRevalueUsageRecord"
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "replayed",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/companies/{company_id}/projects": {
      "get": {
        "operationId": "explorerCompanyProjects",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CompanyProjectReference"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/companies/{company_id}/projects/{target_id}": {
      "get": {
        "operationId": "explorerGetCompanyProjectMapping",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "target_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CompanyRelationshipMapping"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "explorerSetCompanyProjectMapping",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "target_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyRelationshipMutation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CompanyRelationshipMapping"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/companies/{company_id}/opportunities": {
      "get": {
        "operationId": "explorerCompanyOpportunities",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CompanyOpportunityReference"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/companies/{company_id}/opportunities/{target_id}": {
      "get": {
        "operationId": "explorerGetCompanyOpportunityMapping",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "target_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CompanyRelationshipMapping"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "explorerSetCompanyOpportunityMapping",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "target_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyRelationshipMutation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CompanyRelationshipMapping"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/explorer/crm/companies/{company_id}/spend": {
      "get": {
        "operationId": "explorerCompanySpendReferences",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CompanyProjectReference"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/categories": {
      "get": {
        "operationId": "crmCategories",
        "parameters": [
          {
            "name": "category_group",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 250
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CrmCategory"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/ExplorerPage"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "page"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "crmCreateCategory",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmCategoryCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "explorer.v1"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CrmCategory"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "data",
                    "as_of"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/pipelines": {
      "get": {
        "operationId": "crmPipelines",
        "parameters": [
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pipelines": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Pipeline"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "pipelines",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "crmCreatePipeline",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 250
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "stages": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 250
                        },
                        "position": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "is_terminal": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "name",
                        "position",
                        "is_terminal"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Explicit stage names and positions must each be unique; no stages or defaults are inferred."
                  }
                },
                "required": [
                  "collection",
                  "name",
                  "reason",
                  "stages"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Explicit authorized pipeline and stages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pipeline": {
                      "$ref": "#/components/schemas/Pipeline"
                    },
                    "stages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PipelineStage"
                      }
                    }
                  },
                  "required": [
                    "pipeline",
                    "stages"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/pipelines/{pipeline_id}/stages": {
      "get": {
        "operationId": "crmPipelineStages",
        "parameters": [
          {
            "name": "pipeline_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PipelineStage"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "stages",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/companies/{company_id}/opportunities": {
      "post": {
        "operationId": "crmCreateOpportunity",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpportunityCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpportunityResult"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "crmOwnedOpportunities",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 250
            },
            "required": false
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Only caller-owned canonical opportunities, with selected-collection mapping metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "opportunities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "record": {
                            "$ref": "#/components/schemas/Opportunity"
                          },
                          "relationship": {
                            "oneOf": [
                              {
                                "type": "null"
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "version": {
                                    "type": "string",
                                    "pattern": "^[1-9][0-9]{0,18}$"
                                  },
                                  "collection_id": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "active": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "version",
                                  "collection_id",
                                  "active"
                                ],
                                "additionalProperties": true
                              }
                            ]
                          }
                        },
                        "required": [
                          "record",
                          "relationship"
                        ],
                        "additionalProperties": true
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "opportunities",
                    "next_cursor"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/companies/{company_id}/opportunities/{opportunity_id}": {
      "get": {
        "operationId": "crmOpportunity",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "opportunity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpportunityResult"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "crmUpdateOpportunity",
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "opportunity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpportunityUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current caller authorization and canonical records",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpportunityResult"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/filings": {
      "get": {
        "operationId": "crmSourceFilings",
        "parameters": [
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "record_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "contact",
                "company",
                "project",
                "collection"
              ]
            }
          },
          {
            "name": "record_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,7}$"
            }
          },
          {
            "name": "session",
            "in": "query",
            "description": "Active Warden session bound to the calling agent. Required for delegated reads.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current collection-scoped filing data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "filings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CrmSourceFiling"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "filings",
                    "next_cursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "crmFileSource",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmFileSource"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current collection-scoped filing data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmSourceFiling"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/spending": {
      "get": {
        "operationId": "workspaceSpending",
        "summary": "Read authorized metered calls, usage and allocated spending in the requested period",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "project",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "session",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "unallocated",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Totals in original-currency minor units and paginated evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currencies": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "currency": {
                            "type": "string"
                          },
                          "minor_unit_exponent": {
                            "type": "integer"
                          },
                          "estimated_minor": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "pattern": "^-?[0-9]+$"
                          },
                          "provider_billed_minor": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "pattern": "^-?[0-9]+$"
                          },
                          "cash_minor": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "pattern": "^-?[0-9]+$"
                          },
                          "reconciled_cash_minor": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "pattern": "^-?[0-9]+$"
                          }
                        },
                        "required": [
                          "currency",
                          "minor_unit_exponent",
                          "estimated_minor",
                          "provider_billed_minor",
                          "cash_minor",
                          "reconciled_cash_minor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "tool_call_count": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "pattern": "^[0-9]+$"
                    },
                    "measured_units": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      }
                    },
                    "usage_count": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    },
                    "unvalued_usage_count": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "project_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "service": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "occurred_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "agent_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "session_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "kind": {
                                "const": "call"
                              },
                              "usage_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid"
                                }
                              },
                              "usage_link_count": {
                                "type": "string",
                                "pattern": "^[0-9]+$"
                              }
                            },
                            "required": [
                              "id",
                              "project_id",
                              "service",
                              "occurred_at",
                              "agent_id",
                              "session_id",
                              "kind",
                              "usage_ids",
                              "usage_link_count"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "project_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "service": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "occurred_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "agent_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "session_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "currency": {
                                "type": "string"
                              },
                              "minor_unit_exponent": {
                                "type": "integer"
                              },
                              "kind": {
                                "const": "usage"
                              },
                              "account_id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "model": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "rate_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "counts": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "string",
                                  "pattern": "^[0-9]+$"
                                }
                              },
                              "estimated_minor": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "pattern": "^-?[0-9]+$"
                              },
                              "provider_billed_minor": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "pattern": "^-?[0-9]+$"
                              },
                              "settlement_version": {
                                "type": "integer"
                              },
                              "settlements": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "value_minor": {
                                      "type": "string",
                                      "pattern": "^[0-9]+$"
                                    },
                                    "cash_minor": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "pattern": "^-?[0-9]+$"
                                    },
                                    "expense_id": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "format": "uuid"
                                    },
                                    "document_id": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "format": "uuid"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "value_minor",
                                    "cash_minor",
                                    "expense_id",
                                    "document_id"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "allocation": {
                                "enum": [
                                  "project",
                                  "unallocated"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "project_id",
                              "service",
                              "occurred_at",
                              "agent_id",
                              "session_id",
                              "currency",
                              "minor_unit_exponent",
                              "kind",
                              "account_id",
                              "source_id",
                              "model",
                              "rate_id",
                              "counts",
                              "estimated_minor",
                              "provider_billed_minor",
                              "settlement_version",
                              "settlements",
                              "allocation"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "project_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "service": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "occurred_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "currency": {
                                "type": "string"
                              },
                              "minor_unit_exponent": {
                                "type": "integer"
                              },
                              "kind": {
                                "const": "expense"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "invoice_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "document_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "cash_minor": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "pattern": "^-?[0-9]+$"
                              },
                              "allocation": {
                                "enum": [
                                  "project",
                                  "unallocated",
                                  "overhead"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "project_id",
                              "service",
                              "occurred_at",
                              "currency",
                              "minor_unit_exponent",
                              "kind",
                              "source_id",
                              "invoice_id",
                              "document_id",
                              "cash_minor",
                              "allocation"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source_coverage": {
                      "const": "unknown"
                    },
                    "ambiguous_call_count": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    }
                  },
                  "required": [
                    "currencies",
                    "tool_call_count",
                    "measured_units",
                    "usage_count",
                    "unvalued_usage_count",
                    "events",
                    "next_cursor",
                    "source_coverage",
                    "ambiguous_call_count"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace": {
      "get": {
        "operationId": "workspaceSelf",
        "summary": "Read the signed-in employee's organization, roles and granted permissions.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Read the signed-in employee's organization, roles and granted permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceSelf"
                }
              }
            }
          }
        }
      }
    },
    "/v1/access/members": {
      "get": {
        "operationId": "workspacePeople",
        "summary": "Page through membership summaries visible to the administering employee.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page through membership summaries visible to the administering employee.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspacePeople"
                }
              }
            }
          }
        }
      }
    },
    "/v1/access/members/{membership}": {
      "get": {
        "operationId": "workspaceHumanAccess",
        "summary": "Inspect effective human role and resource access.",
        "parameters": [
          {
            "name": "membership",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inspect effective human role and resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceHumanAccess"
                }
              }
            }
          }
        }
      }
    },
    "/v1/access/members/{membership}/grants": {
      "put": {
        "operationId": "workspaceSetHumanAccess",
        "summary": "Preview or apply a human access change against its current revision.",
        "parameters": [
          {
            "name": "membership",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceHumanGrant"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview or apply a human access change against its current revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceHumanChange"
                }
              }
            }
          }
        }
      }
    },
    "/v1/access/members/{membership}/agent-policies": {
      "get": {
        "operationId": "workspaceAgentPolicies",
        "summary": "Inspect the member's internal defaults, agent overrides, human ceiling and effective actions.",
        "parameters": [
          {
            "name": "membership",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inspect the member's internal defaults, agent overrides, human ceiling and effective actions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspacePolicies"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "workspaceSetAgentPolicy",
        "summary": "Preview or change a collection policy against the expected revision. An empty action set denies all. Null removes an override.",
        "parameters": [
          {
            "name": "membership",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceAgentPolicy"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview or change a collection policy against the expected revision. An empty action set denies all. Null removes an override.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspacePolicies"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/records": {
      "get": {
        "operationId": "workspaceCrmRecords",
        "summary": "Read one authorized record with notes, or list records in a collection. Agents supply a live session.",
        "parameters": [
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "contact",
                "company"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "session",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read one authorized record with notes, or list records in a collection. Agents supply a live session.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/WorkspaceRecordDetail"
                    },
                    {
                      "$ref": "#/components/schemas/WorkspaceRecordPage"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/record-actions": {
      "post": {
        "operationId": "workspaceCrmAction",
        "summary": "Perform one explicitly authorized create, append, edit, archive or delete action.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceRecordAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Perform one explicitly authorized create, append, edit, archive or delete action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceMutationReceipt"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/agent-filings": {
      "post": {
        "operationId": "workspaceAgentFiling",
        "summary": "File a LinkedIn thread against a CRM record in a delegated session.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceAgentFiling"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File a LinkedIn thread against a CRM record in a delegated session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceAgentFilingReceipt"
                }
              }
            }
          }
        }
      }
    },
    "/v1/access/members/{membership}/crm-delegation": {
      "put": {
        "operationId": "workspaceSetAgentDelegation",
        "summary": "Grant or revoke one internal CRM permission for a member's agent delegation and collection.",
        "parameters": [
          {
            "name": "membership",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceAgentDelegation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Grant or revoke one internal CRM permission for a member's agent delegation and collection.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspacePolicies"
                }
              }
            }
          }
        }
      }
    },
    "/v1/spending/scopes": {
      "get": {
        "operationId": "workspaceSpendingScopes",
        "summary": "List permitted spending scopes",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available organization and project scopes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "organization",
                    "projects",
                    "next_cursor"
                  ],
                  "properties": {
                    "organization": {
                      "type": "boolean"
                    },
                    "projects": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/filings/{filing_id}/linear-issue": {
      "parameters": [
        {
          "name": "filing_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "crmFollowupLinear",
        "responses": {
          "200": {
            "description": "Current authorized follow-up handoff",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinearFollowup"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "crmLinkFollowupLinear",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "mapping_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "mapping_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current authorized follow-up handoff",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinearFollowup"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/followups": {
      "get": {
        "operationId": "crmPersonalFollowups",
        "parameters": [
          {
            "name": "disposition",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "waiting_on_them",
                "need_to_follow_up"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "schedule",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "groups",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Include group reminders when schedule=1. Group schedule rows include group_id."
          },
          {
            "name": "status",
            "in": "query",
            "description": "History list only. Defaults to open.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "completed"
              ],
              "default": "open"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Open or completed CRM follow-ups owned by the signed-in member, including commitments entered directly on contacts and companies and those captured through filings. Schedule mode keeps the compact notification shape.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "filing_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "collection": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "record_id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "record_type": {
                                "type": "string",
                                "enum": [
                                  "contact",
                                  "company",
                                  "project",
                                  "collection"
                                ]
                              },
                              "subject": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 500
                              },
                              "due_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "date-time"
                              },
                              "provider": {
                                "type": "string",
                                "enum": [
                                  "gmail",
                                  "linkedin",
                                  "manual",
                                  "general"
                                ]
                              },
                              "disposition": {
                                "type": "string",
                                "enum": [
                                  "waiting_on_them",
                                  "need_to_follow_up"
                                ]
                              },
                              "can_complete": {
                                "type": "boolean"
                              },
                              "recurrence": {
                                "anyOf": [
                                  {
                                    "$ref": "#/components/schemas/FollowupRecurrence"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "delivery_state": {
                                "enum": [
                                  null,
                                  "scheduled",
                                  "pending",
                                  "delivered",
                                  "retrying",
                                  "cancelled"
                                ]
                              },
                              "linear_url": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uri"
                              }
                            },
                            "required": [
                              "id",
                              "filing_id",
                              "collection",
                              "record_id",
                              "record_type",
                              "subject",
                              "due_at",
                              "provider",
                              "disposition",
                              "can_complete",
                              "recurrence",
                              "delivery_state",
                              "linear_url"
                            ]
                          },
                          {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "due_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "group_id": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "required": [
                              "id",
                              "due_at"
                            ]
                          }
                        ]
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "items",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/followups/{action_id}/complete": {
      "parameters": [
        {
          "name": "action_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "crmCompletePersonalFollowup",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed completion of your CRM follow-up.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "completed"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/history/people": {
      "get": {
        "operationId": "crmHistoryPeople",
        "summary": "Find people by name or collection email",
        "parameters": [
          {
            "in": "query",
            "name": "collection",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 25
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Find people by name or collection email",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "people": {
                      "type": "array",
                      "maxItems": 25,
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "type": "string"
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "email"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "people",
                    "next_cursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/history/interactions": {
      "get": {
        "operationId": "crmContactHistory",
        "summary": "Read dated interaction subjects for a contact",
        "parameters": [
          {
            "in": "query",
            "name": "collection",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "contact",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "scope",
            "required": false,
            "description": "Use readable to include this same contact’s interactions from all collections the caller can read. The selected contact must be readable in the specified collection.",
            "schema": {
              "type": "string",
              "enum": [
                "collection",
                "readable"
              ],
              "default": "collection"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 25
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read dated interaction subjects for a contact",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "interactions": {
                      "type": "array",
                      "maxItems": 25,
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "subject": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "occurred_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "key",
                          "kind",
                          "subject",
                          "occurred_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "interactions",
                    "next_cursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/filing-destination": {
      "get": {
        "operationId": "crmFilingDestination",
        "summary": "Find a unique previous filing destination for an exact provider conversation",
        "parameters": [
          {
            "in": "query",
            "name": "collection",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "source_url",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri",
              "maxLength": 2048
            }
          },
          {
            "in": "query",
            "name": "mailbox",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Find a unique previous filing destination for an exact provider conversation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "destination": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "record_type": {
                              "type": "string",
                              "enum": [
                                "contact",
                                "company",
                                "project"
                              ]
                            },
                            "record_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "record_type",
                            "record_id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ambiguous": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "destination",
                    "ambiguous"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/reminder-groups": {
      "get": {
        "operationId": "listCrmReminderGroups",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]{0,6})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Personal groups including those without a reminder date.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "groups": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReminderGroup"
                      },
                      "maxItems": 100
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "groups",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createCrmReminderGroup",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Create a personal group. Omit its date to leave it unscheduled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderGroupReceipt"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "due_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/crm/reminder-groups/{id}": {
      "get": {
        "operationId": "getCrmReminderGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]{0,6})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Visible contact and conversation references, grouped by contact within this page. Merge recurring contact IDs across pages.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "group": {
                      "$ref": "#/components/schemas/ReminderGroup"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReminderGroupEntry"
                      },
                      "maxItems": 20
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "group",
                    "entries",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateCrmReminderGroupDate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Set or clear the group date while retaining all its members.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderGroupReceipt"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "due_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  }
                },
                "required": [
                  "due_at"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/crm/reminder-groups/{id}/members": {
      "post": {
        "operationId": "addCrmReminderGroupMember",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Add an accessible contact or filing to a personal group.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "added": {
                      "const": true
                    }
                  },
                  "required": [
                    "added"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmTagTarget"
              }
            }
          }
        }
      }
    },
    "/v1/crm/tags": {
      "get": {
        "operationId": "getCrmTargetTags",
        "parameters": [
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "contact",
                "filing"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current tags on one contact or filed conversation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmTagList"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "changeCrmTargetTags",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Add or remove tags. Supply at least one change. Contact and conversation assignments are independent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmTagList"
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "collection": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "filing"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "add": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "maxItems": 30
                  },
                  "remove": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "maxItems": 30
                  }
                },
                "required": [
                  "collection",
                  "kind",
                  "id"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/crm/tagged": {
      "get": {
        "operationId": "findCrmTaggedRecords",
        "parameters": [
          {
            "name": "collection",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "contact",
                "filing"
              ]
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]{0,6})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Visible records for a given tag and target kind.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TaggedCrmRecord"
                      },
                      "maxItems": 100
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "items",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/email-filings": {
      "get": {
        "operationId": "workspaceEmailFilings",
        "parameters": [
          {
            "name": "collection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "unsorted"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "email",
                "capture"
              ]
            }
          },
          {
            "name": "record_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "contact",
                "company",
                "collection"
              ]
            }
          },
          {
            "name": "record_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized email filing data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/email-filings/{kind}/{id}": {
      "get": {
        "operationId": "workspaceEmailFiling",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "email",
                "capture"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized email filing data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/followups/{action_id}/recurrence": {
      "put": {
        "operationId": "setCrmFollowupRecurrence",
        "summary": "Change or clear recurrence for an open CRM follow-up you control.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "recurrence": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/FollowupRecurrence"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "recurrence"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved recurrence.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "recurrence": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/FollowupRecurrence"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "recurrence"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/followups/{action_id}/occurrences": {
      "get": {
        "operationId": "listCrmFollowupOccurrences",
        "summary": "Read the delivery history of an owned CRM follow-up for a currently visible source.",
        "parameters": [
          {
            "name": "action_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,7}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Newest occurrences first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FollowupOccurrence"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "items",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crm/people": {
      "post": {
        "operationId": "saveCrmPerson",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "collection",
                  "person"
                ],
                "properties": {
                  "collection": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "person": {
                    "$ref": "#/components/schemas/CrmFilingPersonInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Canonical contact saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "crmSearchPeople",
        "summary": "Find accessible canonical people by contact details and return a unique confident match",
        "parameters": [
          {
            "in": "query",
            "name": "collection",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 250
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 25
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "id",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "name",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 250
            }
          },
          {
            "in": "query",
            "name": "email",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 254,
              "format": "email"
            }
          },
          {
            "in": "query",
            "name": "phone",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "in": "query",
            "name": "linkedin",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "format": "uri"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contacts visible to this user in the requested collection",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "people": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CrmPerson"
                      },
                      "maxItems": 25
                    },
                    "selected_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "people",
                    "selected_id",
                    "next_cursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Checked error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/access/invitations": {
      "get": {
        "operationId": "workspacePendingInvitations",
        "summary": "List pending employee invitations for the organization owner.",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List pending employee invitations for the organization owner.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invitations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WorkspaceInvitation"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "invitations",
                    "next_cursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "workspaceInvite",
        "summary": "Create an email-bound employee invitation as the organization owner using a UUID request key.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Create an email-bound employee invitation as the organization owner using a UUID request key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceInvitation"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254
                  },
                  "project_ids": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "tool_ids": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,63}$"
                    },
                    "description": "Ordinary capped metered actions granted on acceptance."
                  }
                },
                "required": [
                  "email"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/access/invitations/{id}": {
      "delete": {
        "operationId": "workspaceRevokeInvitation",
        "summary": "Revoke an outstanding employee invitation.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoke an outstanding employee invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "revoked": {
                      "const": true
                    }
                  },
                  "required": [
                    "id",
                    "revoked"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/access/invitations/{id}/accept": {
      "post": {
        "operationId": "workspaceAcceptInvitation",
        "summary": "Accept an invitation using the verified employee email.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accept an invitation using the verified employee email.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "membership_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "membership_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/access/invitations/{id}/email": {
      "get": {
        "operationId": "workspaceInvitationEmailStatus",
        "summary": "Read the delivery state for a pending employee invitation.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accept an invitation using the verified employee email.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "not_sent",
                        "pending",
                        "accepted",
                        "rejected",
                        "unknown"
                      ]
                    },
                    "configured": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "state",
                    "configured"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "workspaceInvitationEmailSend",
        "summary": "Send an owner-issued invitation to its verified recipient address.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accept an invitation using the verified employee email.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "not_sent",
                        "pending",
                        "accepted",
                        "rejected",
                        "unknown"
                      ]
                    },
                    "configured": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "state",
                    "configured"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "companyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Supabase JWT"
      }
    },
    "schemas": {
      "Error": {
        "x-typescript-type": "CompanyContract.CompanyApiError",
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          },
          "outcome": {
            "enum": [
              "not_attempted",
              "unknown"
            ]
          }
        },
        "required": [
          "error",
          "message"
        ],
        "additionalProperties": false
      },
      "Freshness": {
        "x-typescript-type": "CompanyContract.Freshness",
        "type": "object",
        "properties": {
          "status": {
            "enum": [
              "available",
              "unavailable",
              "stale"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "CurrencyCost": {
        "x-typescript-type": "CompanyContract.CurrencyCost",
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          },
          "cash_allocated_minor_units": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^-?[0-9]+$"
          },
          "usage_valued_minor_units": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^-?[0-9]+$"
          },
          "usage_already_in_cash_minor_units": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^-?[0-9]+$"
          },
          "usage_covered_non_cash_minor_units": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^-?[0-9]+$"
          },
          "net_nonduplicated_total_minor_units": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^-?[0-9]+$"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          },
          "coverage_complete": {
            "type": "boolean"
          }
        },
        "required": [
          "currency",
          "cash_allocated_minor_units",
          "usage_valued_minor_units",
          "usage_already_in_cash_minor_units",
          "usage_covered_non_cash_minor_units",
          "net_nonduplicated_total_minor_units",
          "minor_unit_exponent",
          "amount_basis",
          "coverage_complete"
        ],
        "additionalProperties": false
      },
      "ProjectSummary": {
        "x-typescript-type": "CompanyContract.ProjectSummary",
        "type": "object",
        "additionalProperties": true
      },
      "Contact": {
        "x-typescript-type": "CompanyContract.Contact",
        "type": "object",
        "additionalProperties": true
      },
      "Company": {
        "x-typescript-type": "CompanyContract.Company",
        "type": "object",
        "additionalProperties": true
      },
      "ExternalLink": {
        "x-typescript-type": "CompanyContract.ExternalLink",
        "type": "object",
        "additionalProperties": true
      },
      "CostGroup": {
        "x-typescript-type": "CompanyContract.CostGroup",
        "type": "object",
        "additionalProperties": true
      },
      "Manifest": {
        "x-typescript-type": "AutomationContract.ManifestInput",
        "type": "object",
        "properties": {
          "capabilities": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "enum": [
                "projects.read",
                "crm.read",
                "usage.read",
                "linear.write",
                "notifications.send",
                "checkpoint.read",
                "checkpoint.write"
              ]
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "cpu_ms": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10000
              },
              "subrequests": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "timeout_ms": {
                "type": "integer",
                "minimum": 100,
                "maximum": 60000
              },
              "max_runs_per_day": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10000
              }
            },
            "required": [],
            "additionalProperties": false
          }
        },
        "required": [
          "capabilities"
        ],
        "additionalProperties": false
      },
      "PreparedVersion": {
        "x-typescript-type": "AutomationContract.PreparedVersion",
        "type": "object",
        "additionalProperties": true
      },
      "ContactCreate": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "display_name": {
            "type": "string",
            "maxLength": 250
          },
          "primary_email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          }
        },
        "required": [
          "collection",
          "display_name"
        ],
        "additionalProperties": false
      },
      "CompanyCreate": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 250
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "industry": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          }
        },
        "required": [
          "collection",
          "name"
        ],
        "additionalProperties": false
      },
      "NoteCreate": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "body": {
            "type": "string",
            "maxLength": 16000,
            "minLength": 1
          }
        },
        "required": [
          "collection",
          "body"
        ],
        "additionalProperties": false
      },
      "AutomationCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "capabilities": {
            "type": "array",
            "items": {
              "enum": [
                "projects.read",
                "crm.read",
                "usage.read",
                "linear.write",
                "notifications.send",
                "checkpoint.read",
                "checkpoint.write"
              ]
            }
          }
        },
        "required": [
          "name",
          "capabilities"
        ],
        "additionalProperties": false
      },
      "Trigger": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "const": "interval"
              },
              "interval_seconds": {
                "type": "integer",
                "minimum": 60,
                "maximum": 31536000
              },
              "timezone": {
                "const": "UTC"
              },
              "missed": {
                "enum": [
                  "skip",
                  "once"
                ]
              },
              "overlap": {
                "const": "skip"
              },
              "enabled": {
                "type": "boolean"
              }
            },
            "required": [
              "kind",
              "interval_seconds",
              "timezone",
              "missed",
              "overlap",
              "enabled"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "const": "event"
              },
              "event_type": {
                "type": "string",
                "maxLength": 120
              },
              "timezone": {
                "const": "UTC"
              },
              "missed": {
                "enum": [
                  "skip",
                  "once"
                ]
              },
              "overlap": {
                "const": "skip"
              },
              "enabled": {
                "type": "boolean"
              }
            },
            "required": [
              "kind",
              "event_type",
              "timezone",
              "missed",
              "overlap",
              "enabled"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ContactUpdate": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "display_name": {
            "type": "string",
            "maxLength": 250
          },
          "primary_email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "expected_version": {
            "type": "integer",
            "minimum": 1
          },
          "expected_details_version": {
            "type": "integer",
            "minimum": 1,
            "description": "Required when changing collection-private fields; use details_version from the scoped read."
          }
        },
        "required": [
          "collection",
          "expected_version"
        ],
        "additionalProperties": false,
        "description": "Canonical expected_version always required. expected_details_version additionally required for private email/title/domain/industry changes."
      },
      "CompanyUpdate": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 250
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "industry": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "expected_version": {
            "type": "integer",
            "minimum": 1
          },
          "expected_details_version": {
            "type": "integer",
            "minimum": 1,
            "description": "Required when changing collection-private fields; use details_version from the scoped read."
          }
        },
        "required": [
          "collection",
          "expected_version"
        ],
        "additionalProperties": false,
        "description": "Canonical expected_version always required. expected_details_version additionally required for private email/title/domain/industry changes."
      },
      "ExplorerPage": {
        "x-typescript-type": "ExplorerContract.ExplorerPage",
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "next_cursor",
          "as_of"
        ],
        "additionalProperties": false
      },
      "ExplorerCollection": {
        "x-typescript-type": "ExplorerContract.ExplorerCollection",
        "type": "object",
        "additionalProperties": true
      },
      "ExplorerPerson": {
        "x-typescript-type": "ExplorerContract.ExplorerPerson",
        "type": "object",
        "additionalProperties": true
      },
      "ExplorerCompany": {
        "x-typescript-type": "ExplorerContract.ExplorerCompany",
        "type": "object",
        "additionalProperties": true
      },
      "ExplorerInteraction": {
        "x-typescript-type": "ExplorerContract.ExplorerInteraction",
        "type": "object",
        "additionalProperties": true
      },
      "ExplorerReviewItem": {
        "x-typescript-type": "ExplorerContract.ExplorerReviewItem",
        "type": "object",
        "additionalProperties": true
      },
      "MinorUnits": {
        "x-typescript-type": "FinanceContract.MinorUnits",
        "type": "string",
        "pattern": "^-?[0-9]{1,30}$",
        "description": "Exact original-currency minor units. Never coerce to a JavaScript Number."
      },
      "FinanceMutation": {
        "type": "object",
        "properties": {
          "schema_version": {
            "const": "explorer.v1"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          },
          "replayed": {
            "type": "boolean"
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "schema_version",
          "data",
          "as_of"
        ],
        "additionalProperties": true
      },
      "financePutVendorInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"vendor.put\"]",
        "type": "object",
        "properties": {
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "source_id",
          "name"
        ],
        "additionalProperties": false
      },
      "financePutAccountInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"account.put\"]",
        "type": "object",
        "properties": {
          "vendor_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          }
        },
        "required": [
          "vendor_id",
          "source_id",
          "name",
          "provider"
        ],
        "additionalProperties": false
      },
      "financePutDocumentInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"document.put\"]",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "bucket": {
            "type": "string"
          },
          "object_key": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "source_id",
          "bucket",
          "object_key",
          "sha256",
          "mime_type"
        ],
        "additionalProperties": false
      },
      "financePutInvoiceInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"invoice.put\"]",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "currency": {
            "type": "string"
          },
          "total_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "period_start": {
            "type": "string"
          },
          "period_end": {
            "type": "string"
          },
          "document_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "account_id",
          "source_id",
          "currency",
          "total_minor"
        ],
        "additionalProperties": false
      },
      "financePutSubscriptionInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"subscription.put\"]",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "commitment_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "period_start": {
            "type": "string"
          },
          "period_end": {
            "type": "string"
          },
          "expected_version": {
            "type": "integer",
            "minimum": 0
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "service": {
            "type": "string"
          },
          "resource_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "account_id",
          "source_id",
          "name",
          "status",
          "currency"
        ],
        "additionalProperties": false
      },
      "financeRegisterResourceInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"resource.register\"]",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "service": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "estimated_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string"
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "account_id",
          "source_id",
          "project_id",
          "service",
          "kind"
        ],
        "additionalProperties": false
      },
      "financeUpdateResourceInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"resource.update\"]",
        "type": "object",
        "properties": {
          "resource_id": {
            "type": "string",
            "format": "uuid"
          },
          "expected_version": {
            "type": "integer",
            "minimum": 0
          },
          "status": {
            "type": "string"
          },
          "estimated_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "ended_at": {
            "type": "string"
          }
        },
        "required": [
          "resource_id",
          "expected_version",
          "status"
        ],
        "additionalProperties": false
      },
      "financeRecordExpenseInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"expense.record\"]",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "amount_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string"
          },
          "occurred_at": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "original_expense_id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_id": {
            "type": "string",
            "format": "uuid"
          },
          "subscription_id": {
            "type": "string",
            "format": "uuid"
          },
          "document_id": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": "string"
          },
          "fx": {
            "type": "object",
            "additionalProperties": true
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "service": {
            "type": "string"
          },
          "resource_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "account_id",
          "source_id",
          "amount_minor",
          "currency",
          "occurred_at",
          "kind"
        ],
        "additionalProperties": false
      },
      "financeAllocateExpenseInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"expense.allocate\"]",
        "type": "object",
        "properties": {
          "expense_id": {
            "type": "string",
            "format": "uuid"
          },
          "expected_version": {
            "type": "integer",
            "minimum": 0
          },
          "mode": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "required": [
          "expense_id",
          "expected_version",
          "mode",
          "lines"
        ],
        "additionalProperties": false
      },
      "financeRecordUsageInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"usage.record\"]",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "service": {
            "type": "string"
          },
          "occurred_at": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "estimated_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "provider_billed_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "rate_id": {
            "type": "string",
            "format": "uuid"
          },
          "counts": {
            "type": "object",
            "additionalProperties": true
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "resource_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "account_id",
          "source_id",
          "service",
          "occurred_at",
          "currency"
        ],
        "additionalProperties": false
      },
      "financeSettleUsageInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"usage.settlement\"]",
        "type": "object",
        "properties": {
          "usage_id": {
            "type": "string",
            "format": "uuid"
          },
          "expected_version": {
            "type": "integer",
            "minimum": 0
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "required": [
          "usage_id",
          "expected_version",
          "lines"
        ],
        "additionalProperties": false
      },
      "financePutRateInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"rate.put\"]",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "currency": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "price_minor": {
            "$ref": "#/components/schemas/ExactDecimal"
          },
          "effective_at": {
            "type": "string"
          },
          "rule": {
            "type": "object",
            "additionalProperties": true
          },
          "model": {
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "source_id",
          "currency",
          "unit",
          "price_minor",
          "effective_at",
          "rule"
        ],
        "additionalProperties": false
      },
      "financePutBudgetInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"budget.put\"]",
        "type": "object",
        "properties": {
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "currency": {
            "type": "string"
          },
          "period_start": {
            "type": "string"
          },
          "period_end": {
            "type": "string"
          },
          "amount_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "expected_version": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "project_id",
          "currency",
          "period_start",
          "period_end",
          "amount_minor"
        ],
        "additionalProperties": false
      },
      "financeGrantIngestionInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"ingestion.grant\"]",
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "operations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expires_at": {
            "type": "string"
          },
          "revoked": {
            "type": "boolean"
          }
        },
        "required": [
          "agent_id",
          "account_id",
          "project_id",
          "operations",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "CanonicalProject": {
        "x-typescript-type": "HierarchyContract.CanonicalProject",
        "type": "object",
        "additionalProperties": true
      },
      "ProjectResource": {
        "x-typescript-type": "HierarchyContract.ProjectResource",
        "type": "object",
        "additionalProperties": true
      },
      "HierarchyCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "classification": {
            "enum": [
              "company",
              "fixture",
              "unreviewed"
            ]
          },
          "visibility": {
            "enum": [
              "organization",
              "restricted",
              "private",
              "team"
            ]
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "HierarchyUpdate": {
        "type": "object",
        "properties": {
          "expected_version": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "classification": {
            "enum": [
              "company",
              "fixture",
              "unreviewed"
            ]
          },
          "classification_reason": {
            "type": "string"
          }
        },
        "required": [
          "expected_version"
        ],
        "additionalProperties": false
      },
      "ResourcePropose": {
        "type": "object",
        "properties": {
          "provider": {
            "enum": [
              "github",
              "linear",
              "warden"
            ]
          },
          "type": {
            "enum": [
              "project",
              "repository",
              "commit",
              "pull_request",
              "branch",
              "issue"
            ]
          },
          "external_id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "provenance": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "provider",
          "type",
          "external_id",
          "provenance"
        ],
        "additionalProperties": false
      },
      "ResourceReview": {
        "type": "object",
        "properties": {
          "expected_version": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "status": {
            "enum": [
              "accepted",
              "rejected"
            ]
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "expected_version",
          "status",
          "reason"
        ],
        "additionalProperties": false
      },
      "ExactDecimal": {
        "type": "string",
        "pattern": "^[0-9]{1,18}(\\.[0-9]{1,12})?$",
        "description": "Exact decimal rate in minor units; preserve as string."
      },
      "financePutVendorRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"vendor.put\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financePutAccountRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"account.put\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financePutDocumentRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"document.put\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financePutInvoiceRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"invoice.put\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financePutSubscriptionRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"subscription.put\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financeRegisterResourceRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"resource.register\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financeUpdateResourceRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"resource.update\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financeRecordExpenseRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"expense.record\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financeAllocateExpenseRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"expense.allocate\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financeRecordUsageRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"usage.record\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financeSettleUsageRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"usage.settlement\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financePutRateRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"rate.put\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financePutBudgetRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"budget.put\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financeGrantIngestionRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"ingestion.grant\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "allocation_version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          },
          "minor_unit_exponent": {
            "type": "integer",
            "minimum": 0
          },
          "amount_basis": {
            "const": "minor_units"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "FinanceRecord": {
        "x-typescript-type": "FinanceContract.FinanceRecord",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "financeRevalueUsageInput": {
        "x-typescript-type": "FinanceContract.FinanceInputs[\"usage.revalue\"]",
        "type": "object",
        "properties": {
          "usage_id": {
            "type": "string",
            "format": "uuid"
          },
          "expected_version": {
            "type": "integer",
            "minimum": 1
          },
          "estimated_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "provider_billed_minor": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "rate_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "usage_id",
          "expected_version"
        ],
        "minProperties": 3,
        "additionalProperties": false
      },
      "financeRevalueUsageRecord": {
        "x-typescript-type": "FinanceContract.FinanceResults[\"usage.revalue\"]",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "settlement_version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "version",
          "settlement_version"
        ],
        "additionalProperties": true
      },
      "FinanceSpend": {
        "x-typescript-type": "FinanceContract.FinanceSpend",
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "currencies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CurrencyCost"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostGroup"
            }
          },
          "groups_page": {
            "$ref": "#/components/schemas/ExplorerPage"
          },
          "group_by": {
            "enum": [
              "user",
              "service",
              "user,service"
            ]
          },
          "has_financial_data": {
            "type": "boolean"
          },
          "allocation_completeness": {
            "const": "unknown"
          },
          "source_coverage": {
            "const": "unknown"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "format": "date-time"
              },
              "to": {
                "type": "string",
                "format": "date-time"
              },
              "boundary": {
                "const": "half_open"
              }
            },
            "required": [
              "from",
              "to",
              "boundary"
            ],
            "additionalProperties": false
          },
          "line_items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "required": [
          "project_id",
          "currencies",
          "groups",
          "groups_page",
          "group_by",
          "has_financial_data",
          "allocation_completeness",
          "source_coverage",
          "period",
          "line_items"
        ],
        "additionalProperties": true
      },
      "CompanyRelationshipMapping": {
        "x-typescript-type": "ExplorerContract.CompanyRelationshipMapping",
        "type": "object",
        "additionalProperties": true
      },
      "CompanyRelationshipMutation": {
        "x-typescript-type": "ExplorerContract.CompanyRelationshipMutation",
        "type": "object",
        "properties": {
          "collection_id": {
            "type": "string",
            "format": "uuid"
          },
          "expected_version": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,18})$"
          },
          "active": {
            "type": "boolean"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        },
        "required": [
          "collection_id",
          "expected_version",
          "active",
          "reason"
        ],
        "additionalProperties": false
      },
      "CompanyProjectReference": {
        "x-typescript-type": "ExplorerContract.CompanyProjectReference",
        "type": "object",
        "additionalProperties": true
      },
      "CompanyOpportunityReference": {
        "x-typescript-type": "ExplorerContract.CompanyOpportunityReference",
        "type": "object",
        "additionalProperties": true
      },
      "CrmCategory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "category_group": {
            "type": "string",
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "maxLength": 250
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "truncated_fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "category_group",
          "name",
          "description",
          "created_at",
          "truncated_fields"
        ],
        "additionalProperties": true
      },
      "CrmCategoryCreate": {
        "type": "object",
        "properties": {
          "category_group": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 250
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          }
        },
        "required": [
          "category_group",
          "name"
        ],
        "additionalProperties": false
      },
      "Pipeline": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "name_truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": true
      },
      "PipelineStage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "pipeline_id": {
            "type": "string",
            "format": "uuid"
          },
          "position": {
            "type": "integer",
            "minimum": 0
          },
          "is_terminal": {
            "type": "boolean"
          },
          "name_truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "pipeline_id",
          "position",
          "is_terminal"
        ],
        "additionalProperties": true
      },
      "Opportunity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "company_id": {
            "type": "string",
            "format": "uuid"
          },
          "pipeline_id": {
            "type": "string",
            "format": "uuid"
          },
          "stage_id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$"
          },
          "name": {
            "type": "string"
          },
          "name_truncated": {
            "type": "boolean"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "description_status": {
            "enum": [
              "available",
              "too_large"
            ]
          },
          "description_preview": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^-?[0-9]{1,16}(\\.[0-9]{1,2})?$"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency_status": {
            "enum": [
              "available",
              "too_large"
            ]
          },
          "expected_close_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        },
        "required": [
          "id",
          "company_id",
          "pipeline_id",
          "stage_id",
          "version",
          "name",
          "amount",
          "currency"
        ],
        "additionalProperties": true
      },
      "OpportunityCreate": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 250
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 16000
          },
          "pipeline_id": {
            "type": "string",
            "format": "uuid"
          },
          "stage_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^-?[0-9]{1,16}(\\.[0-9]{1,2})?$",
            "description": "Existing CRM NUMERIC(18,2) exact decimal, distinct from finance minor units. More than two fractional digits are refused without rounding."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{3}$"
          },
          "expected_close_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        },
        "required": [
          "collection",
          "reason",
          "name",
          "pipeline_id",
          "stage_id"
        ],
        "additionalProperties": false,
        "dependentRequired": {
          "pipeline_id": [
            "stage_id"
          ],
          "stage_id": [
            "pipeline_id"
          ],
          "amount": [
            "currency"
          ],
          "currency": [
            "amount"
          ]
        }
      },
      "OpportunityUpdate": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 250
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 16000
          },
          "pipeline_id": {
            "type": "string",
            "format": "uuid"
          },
          "stage_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^-?[0-9]{1,16}(\\.[0-9]{1,2})?$",
            "description": "Existing CRM NUMERIC(18,2) exact decimal, distinct from finance minor units. More than two fractional digits are refused without rounding."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{3}$"
          },
          "expected_close_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "expected_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$"
          }
        },
        "required": [
          "collection",
          "reason",
          "expected_version"
        ],
        "additionalProperties": false,
        "dependentRequired": {
          "pipeline_id": [
            "stage_id"
          ],
          "stage_id": [
            "pipeline_id"
          ],
          "amount": [
            "currency"
          ],
          "currency": [
            "amount"
          ]
        }
      },
      "OpportunityResult": {
        "type": "object",
        "properties": {
          "record": {
            "$ref": "#/components/schemas/Opportunity"
          },
          "relationship": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "version": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,18}$"
              }
            },
            "required": [
              "id",
              "version"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "record",
          "relationship"
        ],
        "additionalProperties": true
      },
      "CrmFileSource": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "collection": {
                "type": "string",
                "format": "uuid"
              },
              "record_type": {
                "type": "string",
                "enum": [
                  "contact",
                  "company",
                  "project",
                  "collection"
                ]
              },
              "record_id": {
                "type": "string",
                "format": "uuid"
              },
              "source_url": {
                "type": "string",
                "format": "uri",
                "maxLength": 4096
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000
              },
              "followup_at": {
                "type": "string",
                "format": "date-time"
              },
              "mailbox": {
                "type": "string",
                "format": "uuid",
                "description": "Connected Gmail mailbox UUID. Gmail accepts only authorized imported threads. Omit for a LinkedIn link."
              },
              "disposition": {
                "type": "string",
                "enum": [
                  "none",
                  "waiting_on_them",
                  "need_to_follow_up"
                ],
                "description": "Waiting defaults to three weekdays if a due date is omitted. A personal follow-up can be undated."
              },
              "subject": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "description": "Display subject for selected LinkedIn conversation. For Gmail the connected thread provides the subject."
              },
              "contact_tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "maxItems": 30,
                "description": "Tags for the selected CRM contact."
              },
              "conversation_tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "maxItems": 30,
                "description": "Tags for this filing."
              },
              "reminder_group_id": {
                "type": "string",
                "format": "uuid",
                "description": "Attach this filing to a personal reminder group."
              },
              "subject_override": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "description": "Confirmed display title; the original provider thread title is preserved."
              },
              "people": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CrmFilingPersonInput"
                },
                "maxItems": 20
              }
            },
            "required": [
              "collection",
              "record_type",
              "record_id",
              "source_url"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "collection": {
                "type": "string",
                "format": "uuid"
              },
              "record_type": {
                "type": "string",
                "enum": [
                  "contact",
                  "company",
                  "project",
                  "collection"
                ]
              },
              "record_id": {
                "type": "string",
                "format": "uuid"
              },
              "source_url": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "maxLength": 2048
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000
              },
              "followup_at": {
                "type": "string",
                "format": "date-time"
              },
              "disposition": {
                "type": "string",
                "enum": [
                  "none",
                  "waiting_on_them",
                  "need_to_follow_up"
                ],
                "description": "Waiting defaults to three weekdays if a due date is omitted. A personal follow-up can be undated."
              },
              "subject": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "description": "Display subject for selected LinkedIn conversation. For Gmail the connected thread provides the subject."
              },
              "contact_tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "maxItems": 30,
                "description": "Tags for the selected CRM contact."
              },
              "conversation_tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "maxItems": 30,
                "description": "Tags for this filing."
              },
              "reminder_group_id": {
                "type": "string",
                "format": "uuid",
                "description": "Attach this filing to a personal reminder group."
              },
              "subject_override": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "description": "Confirmed display title; the original provider thread title is preserved."
              },
              "people": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CrmFilingPersonInput"
                },
                "maxItems": 20
              },
              "provider": {
                "const": "general"
              },
              "capture_id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "collection",
              "record_type",
              "record_id",
              "provider",
              "capture_id"
            ],
            "additionalProperties": false
          }
        ]
      },
      "CrmSourceFiling": {
        "type": "object",
        "properties": {
          "source": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "provider": {
                "type": "string"
              },
              "external_id": {
                "type": "string"
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri"
              }
            },
            "required": [
              "id",
              "provider",
              "external_id",
              "url"
            ],
            "additionalProperties": false
          },
          "filing": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "record_type": {
                "type": "string",
                "enum": [
                  "contact",
                  "company",
                  "project",
                  "collection"
                ]
              },
              "record_id": {
                "type": "string",
                "format": "uuid"
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "followup_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "subject": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 500
              },
              "disposition": {
                "type": "string",
                "enum": [
                  "none",
                  "waiting_on_them",
                  "need_to_follow_up"
                ]
              },
              "interaction_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "contact_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "maxItems": 21
              }
            },
            "required": [
              "id",
              "record_type",
              "record_id",
              "note",
              "followup_at",
              "created_at"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "source",
          "filing"
        ],
        "additionalProperties": false
      },
      "WorkspaceSelf": {
        "type": "object",
        "properties": {
          "organization": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "slug",
              "name"
            ],
            "additionalProperties": false
          },
          "membership": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "user_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "id",
              "user_id"
            ],
            "additionalProperties": false
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "source",
                "role"
              ],
              "additionalProperties": false
            }
          },
          "spending_projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "source"
              ],
              "additionalProperties": false
            }
          },
          "collections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                },
                "actions": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "create",
                      "append",
                      "read",
                      "edit",
                      "archive",
                      "delete"
                    ]
                  }
                },
                "purpose": {
                  "type": "string",
                  "enum": [
                    "directory",
                    "private_intake"
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "actions"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "organization",
          "membership",
          "roles",
          "permissions",
          "projects",
          "spending_projects",
          "collections"
        ],
        "additionalProperties": false
      },
      "WorkspacePeople": {
        "type": "object",
        "properties": {
          "people": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "membership_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "user_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "email": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string"
                },
                "roles": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "membership_id",
                "user_id",
                "email",
                "status",
                "roles"
              ],
              "additionalProperties": false
            }
          },
          "next_offset": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "people",
          "next_offset"
        ],
        "additionalProperties": false
      },
      "WorkspaceHumanAccess": {
        "type": "object",
        "properties": {
          "membership_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "status": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "source",
                "role"
              ],
              "additionalProperties": false
            }
          },
          "collections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "level": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "source",
                "level"
              ],
              "additionalProperties": false
            }
          },
          "collection_actions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "create",
                    "append",
                    "read",
                    "edit",
                    "archive",
                    "delete"
                  ]
                },
                "source": {
                  "type": "string",
                  "const": "direct"
                }
              },
              "required": [
                "id",
                "action",
                "source"
              ],
              "additionalProperties": false
            }
          },
          "effective_collection_actions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "create",
                    "append",
                    "read",
                    "edit",
                    "archive",
                    "delete"
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "role",
                    "direct"
                  ]
                }
              },
              "required": [
                "id",
                "action",
                "source"
              ],
              "additionalProperties": false
            }
          },
          "spending_projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "source"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "membership_id",
          "status",
          "roles",
          "permissions",
          "revision",
          "projects",
          "collections",
          "collection_actions",
          "effective_collection_actions",
          "spending_projects"
        ],
        "additionalProperties": false
      },
      "WorkspaceHumanGrant": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "role"
              },
              "target": {
                "type": "null"
              },
              "level": {
                "type": "string",
                "enum": [
                  "admin",
                  "member",
                  "viewer"
                ]
              },
              "expected_revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "preview": {
                "type": "boolean"
              }
            },
            "required": [
              "kind",
              "target",
              "level",
              "expected_revision"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "project"
              },
              "target": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "level": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "member"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "expected_revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "preview": {
                "type": "boolean"
              }
            },
            "required": [
              "kind",
              "target",
              "level",
              "expected_revision"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "project_spending"
              },
              "target": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "level": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "viewer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "expected_revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "preview": {
                "type": "boolean"
              }
            },
            "required": [
              "kind",
              "target",
              "level",
              "expected_revision"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "collection_read",
                  "collection_create",
                  "collection_append",
                  "collection_edit",
                  "collection_delete",
                  "collection_archive"
                ]
              },
              "target": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "level": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "allow"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "expected_revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "preview": {
                "type": "boolean"
              }
            },
            "required": [
              "kind",
              "target",
              "level",
              "expected_revision"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "collection"
              },
              "target": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "level": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "viewer",
                      "editor",
                      "manager"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "expected_revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "preview": {
                "type": "boolean"
              }
            },
            "required": [
              "kind",
              "target",
              "level",
              "expected_revision"
            ],
            "additionalProperties": false
          }
        ]
      },
      "WorkspaceHumanChange": {
        "type": "object",
        "properties": {
          "before": {
            "type": "object",
            "properties": {
              "membership_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "status": {
                "type": "string"
              },
              "roles": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "permissions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "projects": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "source",
                    "role"
                  ],
                  "additionalProperties": false
                }
              },
              "collections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "level": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "source",
                    "level"
                  ],
                  "additionalProperties": false
                }
              },
              "collection_actions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "create",
                        "append",
                        "read",
                        "edit",
                        "archive",
                        "delete"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "const": "direct"
                    }
                  },
                  "required": [
                    "id",
                    "action",
                    "source"
                  ],
                  "additionalProperties": false
                }
              },
              "effective_collection_actions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "create",
                        "append",
                        "read",
                        "edit",
                        "archive",
                        "delete"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "role",
                        "direct"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "action",
                    "source"
                  ],
                  "additionalProperties": false
                }
              },
              "spending_projects": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "source"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "membership_id",
              "status",
              "roles",
              "permissions",
              "revision",
              "projects",
              "collections",
              "collection_actions",
              "effective_collection_actions",
              "spending_projects"
            ],
            "additionalProperties": false
          },
          "after": {
            "type": "object",
            "properties": {
              "membership_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "status": {
                "type": "string"
              },
              "roles": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "permissions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "projects": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "source",
                    "role"
                  ],
                  "additionalProperties": false
                }
              },
              "collections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "level": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "source",
                    "level"
                  ],
                  "additionalProperties": false
                }
              },
              "collection_actions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "create",
                        "append",
                        "read",
                        "edit",
                        "archive",
                        "delete"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "const": "direct"
                    }
                  },
                  "required": [
                    "id",
                    "action",
                    "source"
                  ],
                  "additionalProperties": false
                }
              },
              "effective_collection_actions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "create",
                        "append",
                        "read",
                        "edit",
                        "archive",
                        "delete"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "role",
                        "direct"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "action",
                    "source"
                  ],
                  "additionalProperties": false
                }
              },
              "spending_projects": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "source"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "membership_id",
              "status",
              "roles",
              "permissions",
              "revision",
              "projects",
              "collections",
              "collection_actions",
              "effective_collection_actions",
              "spending_projects"
            ],
            "additionalProperties": false
          },
          "preview": {
            "type": "boolean"
          }
        },
        "required": [
          "before",
          "after",
          "preview"
        ],
        "additionalProperties": false
      },
      "WorkspaceAgentPolicy": {
        "type": "object",
        "properties": {
          "collection_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "actions": {
            "anyOf": [
              {
                "maxItems": 6,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "create",
                    "append",
                    "read",
                    "edit",
                    "archive",
                    "delete"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "expected_revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "preview": {
            "type": "boolean"
          }
        },
        "required": [
          "collection_id",
          "agent_id",
          "actions",
          "expected_revision"
        ],
        "additionalProperties": false
      },
      "WorkspacePolicies": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "agents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false
            }
          },
          "default_actions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "create",
                "append",
                "read",
                "edit",
                "archive",
                "delete"
              ]
            }
          },
          "delegations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "agent_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "grants": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "collection_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "permission": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "collection_id",
                      "permission"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "id",
                "agent_id",
                "grants"
              ],
              "additionalProperties": false
            }
          },
          "policies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "collection_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "agent_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "actions": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "create",
                      "append",
                      "read",
                      "edit",
                      "archive",
                      "delete"
                    ]
                  }
                },
                "human_ceiling": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "create",
                      "append",
                      "read",
                      "edit",
                      "archive",
                      "delete"
                    ]
                  }
                },
                "effective_actions": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "create",
                      "append",
                      "read",
                      "edit",
                      "archive",
                      "delete"
                    ]
                  }
                }
              },
              "required": [
                "collection_id",
                "agent_id",
                "actions",
                "human_ceiling",
                "effective_actions"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "revision",
          "agents",
          "default_actions",
          "delegations",
          "policies"
        ],
        "additionalProperties": false
      },
      "WorkspaceRecordDetail": {
        "type": "object",
        "properties": {
          "record": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "archived_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "version",
              "archived_at"
            ],
            "additionalProperties": false
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "body": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string"
                },
                "follow_up_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "follow_up_title": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "body",
                "created_at",
                "follow_up_at",
                "follow_up_title"
              ],
              "additionalProperties": false
            }
          },
          "notes_limit": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "record",
          "notes",
          "notes_limit"
        ],
        "additionalProperties": false
      },
      "WorkspaceRecordPage": {
        "type": "object",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "archived_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "version",
                "archived_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "records",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WorkspaceRecordAction": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "collection": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "contact",
                  "company"
                ]
              },
              "id": {
                "type": "null"
              },
              "session": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "action": {
                "type": "string",
                "const": "create"
              },
              "input": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 250
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "collection",
              "kind",
              "action",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "collection": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "contact",
                  "company"
                ]
              },
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "session": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "action": {
                "type": "string",
                "const": "append"
              },
              "input": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "body": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 16000
                      }
                    },
                    "required": [
                      "body"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 250
                      },
                      "follow_up_at": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      "recurrence": {
                        "$ref": "#/components/schemas/FollowupRecurrence"
                      }
                    },
                    "required": [
                      "title",
                      "follow_up_at"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "collection",
              "kind",
              "id",
              "action",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "collection": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "contact",
                  "company"
                ]
              },
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "session": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "action": {
                "type": "string",
                "const": "edit"
              },
              "input": {
                "type": "object",
                "properties": {
                  "expected_version": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 250
                  }
                },
                "required": [
                  "expected_version",
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "collection",
              "kind",
              "id",
              "action",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "collection": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "contact",
                  "company"
                ]
              },
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "session": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "action": {
                "type": "string",
                "const": "archive"
              },
              "input": {
                "type": "object",
                "properties": {
                  "expected_version": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "expected_version"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "collection",
              "kind",
              "id",
              "action",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "collection": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "contact",
                  "company"
                ]
              },
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "session": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "action": {
                "type": "string",
                "const": "delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "expected_version": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "expected_version"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "collection",
              "kind",
              "id",
              "action",
              "input"
            ],
            "additionalProperties": false
          }
        ]
      },
      "WorkspaceMutationReceipt": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "action": {
                "type": "string",
                "const": "append"
              },
              "note_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "followup_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "id",
              "action",
              "note_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "create",
                  "edit",
                  "archive",
                  "delete"
                ]
              },
              "version": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "action",
              "version"
            ],
            "additionalProperties": false
          }
        ]
      },
      "WorkspaceAgentFiling": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "session": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "contact",
              "company",
              "project"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "source_url": {
            "type": "string",
            "maxLength": 2048
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          },
          "followup_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "collection",
          "session",
          "kind",
          "id",
          "source_url"
        ],
        "additionalProperties": false
      },
      "WorkspaceAgentFilingReceipt": {
        "type": "object",
        "properties": {
          "source_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "filing_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "record_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "source_id",
          "filing_id",
          "record_id"
        ],
        "additionalProperties": false
      },
      "WorkspaceAgentDelegation": {
        "type": "object",
        "properties": {
          "delegation_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "collection_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "permission": {
            "type": "string",
            "enum": [
              "crm.read",
              "crm.create",
              "crm.update",
              "crm.delete"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "expected_revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "delegation_id",
          "collection_id",
          "permission",
          "enabled",
          "expected_revision"
        ],
        "additionalProperties": false
      },
      "LinearFollowup": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "linked": {
            "type": "boolean"
          },
          "can_link": {
            "type": "boolean"
          },
          "issue": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "mapping_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "project_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "external_id": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "required": [
                  "mapping_id",
                  "project_id",
                  "external_id",
                  "url"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "linked",
          "can_link",
          "issue"
        ]
      },
      "ReminderGroup": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "due_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "due_at"
        ]
      },
      "ReminderGroupReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "group": {
            "$ref": "#/components/schemas/ReminderGroup"
          }
        },
        "required": [
          "group"
        ]
      },
      "ReminderGroupFiling": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "provider": {
            "type": "string",
            "enum": [
              "gmail",
              "linkedin",
              "general"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 4096
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "collection",
          "provider",
          "url",
          "subject",
          "note",
          "created_at"
        ]
      },
      "ReminderGroupEntry": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "contact_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "filings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReminderGroupFiling"
            },
            "maxItems": 20
          }
        },
        "required": [
          "contact_id",
          "collection",
          "name",
          "filings"
        ]
      },
      "CrmTagTarget": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "collection": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "contact",
              "filing"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "collection",
          "kind",
          "id"
        ]
      },
      "CrmTagList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        },
        "required": [
          "tags"
        ]
      },
      "TaggedCrmRecord": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "record_type": {
            "type": "string",
            "enum": [
              "contact",
              "company",
              "project",
              "collection"
            ]
          },
          "record_id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 4096
          }
        },
        "required": [
          "id",
          "label",
          "record_type",
          "record_id",
          "url"
        ]
      },
      "FollowupRecurrence": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "unit": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month"
            ]
          },
          "interval": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "time_zone": {
            "type": "string",
            "description": "IANA time zone used for calendar recurrence."
          }
        },
        "required": [
          "unit",
          "interval",
          "time_zone"
        ]
      },
      "FollowupOccurrence": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "due_at": {
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "type": "string",
            "enum": [
              "scheduled",
              "pending",
              "retrying",
              "delivered",
              "cancelled"
            ]
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "linear_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          }
        },
        "required": [
          "id",
          "due_at",
          "state",
          "delivered_at",
          "linear_url"
        ]
      },
      "CrmFilingPersonInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "expected_version": {
                "type": "integer",
                "minimum": 1
              },
              "company": {
                "type": "string",
                "minLength": 1,
                "maxLength": 250
              },
              "emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 254,
                  "format": "email"
                },
                "maxItems": 10,
                "minItems": 1
              },
              "phones": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "maxItems": 10,
                "minItems": 1
              },
              "linkedin": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "format": "uri"
              }
            },
            "required": [
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 250
              },
              "company": {
                "type": "string",
                "minLength": 1,
                "maxLength": 250
              },
              "emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 254,
                  "format": "email"
                },
                "maxItems": 10,
                "minItems": 1
              },
              "phones": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "maxItems": 10,
                "minItems": 1
              },
              "linkedin": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "format": "uri"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          }
        ],
        "description": "Confirm an existing person or create one at Save. Supply the current expected_version for any existing-person update."
      },
      "CrmPerson": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 250
          },
          "company": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 250
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 320
            }
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "linkedin": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 512
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "match": {
            "enum": [
              "email",
              "phone",
              "linkedin",
              "name",
              null
            ]
          }
        },
        "required": [
          "id",
          "name",
          "company",
          "emails",
          "phones",
          "linkedin",
          "version",
          "match"
        ],
        "additionalProperties": false
      },
      "WorkspaceInvitation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "email_state": {
            "type": "string",
            "enum": [
              "not_sent",
              "pending",
              "accepted",
              "rejected",
              "unknown"
            ]
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "tool_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "email",
          "expires_at"
        ],
        "additionalProperties": false
      }
    }
  }
}
