{
  "openapi": "3.1.0",
  "info": {
    "title": "Scopable API",
    "version": "1.0.0",
    "description": "The Scopable tenant API, version 1. Every operation here can be called with a Scopable API key and acts on the key's own workspace only. Requests and responses are validated against exactly these schemas. List operations are cursor-paged (limit 1 to 200, default 50); every error uses the ErrorEnvelope shape, and its `type` resolves to the schema here that describes its code; every command requires an Idempotency-Key header; limits are reported in RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset and RateLimit-Policy headers, and a refused call (429) carries Retry-After."
  },
  "servers": [
    {
      "url": "https://api.scopable.io"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/v1/clients/filter-options": {
      "get": {
        "operationId": "client.filter_options",
        "summary": "List the client roster's filter options",
        "description": "Lists client roster filter choices in the caller's tenant. Signed-in users receive the distinct account types, owners, frameworks and exact status values displayed by visible clients across the full roster. API keys receive active account types, live people and scoped frameworks, with an empty statuses list. Each option is a value to filter on and the label to show.",
        "tags": [
          "client"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "List the client roster's filter options",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accountTypes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "value",
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "owners": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "value",
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "frameworks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "value",
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "statuses": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "value",
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "accountTypes",
                    "owners",
                    "frameworks",
                    "statuses"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/roster-counts": {
      "get": {
        "operationId": "client.roster_counts",
        "summary": "Count the client roster's tabs",
        "description": "Counts the caller's visible clients for each roster tab (all, active, at risk, sync issues, onboarding) under the same search and filters the roster applies. Search matches client name, contact, email, website, industry and city, plus clients whose owner or compliance framework matches. Filters are comma-separated lists. Use statusesJson, a JSON array, for status values containing commas.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "accountTypeIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "frameworkIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statuses",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusesJson",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 101501
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Count the client roster's tabs",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "all": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "active": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "atRisk": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "syncIssues": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "onboarding": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "all",
                    "active",
                    "atRisk",
                    "syncIssues",
                    "onboarding"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/synced-count": {
      "get": {
        "operationId": "client.synced_count",
        "summary": "Count clients synced from a PSA",
        "description": "Counts the caller's clients that a ConnectWise or Halo source still claims and that are not archived.",
        "tags": [
          "client"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Count clients synced from a PSA",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "count"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/dashboard-summary": {
      "get": {
        "operationId": "client.dashboard_summary",
        "summary": "Get a client's overview card",
        "description": "Summarizes one client in the caller's tenant for its overview card: profile and owner, active monthly recurring revenue from agreements, open and recent quotes, the opportunity pipeline and win rate, compliance frameworks with their latest score and open gaps by severity, and SimpleSat CSAT/NPS over 90 days with its coverage. A client outside the tenant answers not_found. The client's status, logo and owner are null for an API key.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client's overview card",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "generatedAt": {
                      "type": "string"
                    },
                    "client": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "primaryContactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "primaryContactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "annualRevenue": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "employeeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "logoUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "logoFilePath": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "industry",
                        "primaryContactName",
                        "primaryContactEmail",
                        "phone",
                        "website",
                        "annualRevenue",
                        "employeeCount",
                        "status",
                        "logoUrl",
                        "logoFilePath"
                      ],
                      "additionalProperties": false
                    },
                    "accountOwner": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "name": {
                              "type": "string"
                            },
                            "email": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "email",
                            "avatarUrl"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "financials": {
                      "type": "object",
                      "properties": {
                        "activeMrr": {
                          "type": "number"
                        },
                        "activeAgreementCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "activeMrr",
                        "activeAgreementCount"
                      ],
                      "additionalProperties": false
                    },
                    "quotes": {
                      "type": "object",
                      "properties": {
                        "openCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "openValue": {
                          "type": "number"
                        },
                        "recent": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "status": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "salesStage": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "amount": {
                                "type": "number"
                              },
                              "createdAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "expirationDate": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "name",
                              "status",
                              "salesStage",
                              "amount",
                              "createdAt",
                              "expirationDate"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "openCount",
                        "openValue",
                        "recent"
                      ],
                      "additionalProperties": false
                    },
                    "opportunities": {
                      "type": "object",
                      "properties": {
                        "openCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "wonCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "lostCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "openPipelineValue": {
                          "type": "number"
                        },
                        "wonValue": {
                          "type": "number"
                        },
                        "winRate": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "openCount",
                        "wonCount",
                        "lostCount",
                        "openPipelineValue",
                        "wonValue",
                        "winRate"
                      ],
                      "additionalProperties": false
                    },
                    "compliance": {
                      "type": "object",
                      "properties": {
                        "frameworks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "version": {
                                "type": "string"
                              },
                              "score": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "version",
                              "score"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "averageScore": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "openGapCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "gapsBySeverity": {
                          "type": "object",
                          "properties": {
                            "critical": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "high": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "medium": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "low": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "unknown": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "critical",
                            "high",
                            "medium",
                            "low",
                            "unknown"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "frameworks",
                        "averageScore",
                        "openGapCount",
                        "gapsBySeverity"
                      ],
                      "additionalProperties": false
                    },
                    "csatNps": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "lastResponseAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "responseCount90d": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "csatAverage90d": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "npsScore90d": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "sentimentBreakdown": {
                              "type": "object",
                              "properties": {
                                "positive": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "neutral": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "negative": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "mixed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "unknown": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "positive",
                                "neutral",
                                "negative",
                                "mixed",
                                "unknown"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "lastResponseAt",
                            "responseCount90d",
                            "csatAverage90d",
                            "npsScore90d",
                            "sentimentBreakdown"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sourceCoverage": {
                      "type": "object",
                      "properties": {
                        "csat": {
                          "type": "object",
                          "properties": {
                            "available": {
                              "type": "boolean"
                            },
                            "provider": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "simplesat"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "not_configured",
                                "not_mapped",
                                "no_data",
                                "available",
                                "stale",
                                "sync_failed"
                              ]
                            },
                            "reason": {
                              "type": "string"
                            },
                            "lastSyncedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "lastErrorAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "available",
                            "provider",
                            "status",
                            "reason",
                            "lastSyncedAt",
                            "lastErrorAt"
                          ],
                          "additionalProperties": false
                        },
                        "projects": {
                          "type": "object",
                          "properties": {
                            "available": {
                              "type": "boolean",
                              "const": false
                            },
                            "reason": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "available",
                            "reason"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "csat",
                        "projects"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "generatedAt",
                    "client",
                    "accountOwner",
                    "financials",
                    "quotes",
                    "opportunities",
                    "compliance",
                    "csatNps",
                    "sourceCoverage"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/ai-overview": {
      "get": {
        "operationId": "client.ai_overview_get",
        "summary": "Get a client's cached AI briefing",
        "description": "Reads the most recently generated AI briefing for one client in the caller's tenant, with the web sources it cited, or null when none has been generated. A client outside the tenant answers not_found. Generating a briefing is not part of this operation.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client's cached AI briefing",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "overview": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "tenantId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "clientId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "briefing": {
                              "type": "string"
                            },
                            "generatedAt": {
                              "type": "string"
                            },
                            "generatedBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "promptVersion": {
                              "type": "string"
                            },
                            "sourceMetadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "webSearchSources": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "url": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "domain": {
                                    "type": "string"
                                  },
                                  "pageAge": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "toolUseId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "url",
                                  "title",
                                  "domain",
                                  "pageAge",
                                  "toolUseId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "clientId",
                            "briefing",
                            "generatedAt",
                            "generatedBy",
                            "promptVersion",
                            "sourceMetadata",
                            "webSearchSources"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "overview"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients": {
      "get": {
        "operationId": "client.list",
        "summary": "List clients",
        "description": "Pages through the clients in the caller's tenant, newest name-independent order: sorted by id so a cursor is stable while rows are written. Archived clients and clients a source has removed are excluded.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List clients",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "website": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "industry": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phone": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "contactEmail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "contactName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "addressLine2": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "state": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "zipCode": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "employeeCount": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "annualRevenue": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "website",
                          "industry",
                          "phone",
                          "contactEmail",
                          "contactName",
                          "address",
                          "addressLine2",
                          "city",
                          "state",
                          "zipCode",
                          "country",
                          "employeeCount",
                          "annualRevenue",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "client.create",
        "summary": "Create a client",
        "description": "Creates a client in the caller's tenant, optionally with its primary contact and default location in the same step. An active client with the same name (ignoring case) answers conflict. A primary contact needs a name, or a first or last name.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "fields": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 1000
                      },
                      "industry": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "employeeCount": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "address": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "addressLine2": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "city": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "state": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "zipCode": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "country": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "website": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "faxNumber": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "cwCompanyTypes": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "primaryContact": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "firstName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "lastName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "email": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "title": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "defaultLocation": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "addressLine1": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "addressLine2": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "city": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "state": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "zip": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "country": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "fields"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a client",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zipCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "employeeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "annualRevenue": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "website",
                        "industry",
                        "phone",
                        "contactEmail",
                        "contactName",
                        "address",
                        "addressLine2",
                        "city",
                        "state",
                        "zipCode",
                        "country",
                        "employeeCount",
                        "annualRevenue",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "primaryContactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "defaultSiteId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "client",
                    "primaryContactId",
                    "defaultSiteId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}": {
      "get": {
        "operationId": "client.get",
        "summary": "Get a client",
        "description": "Reads one client by id from the caller's tenant. An id that belongs to another tenant answers not_found; existence is never leaked across tenants.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "industry": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "phone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contactEmail": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contactName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "address": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "addressLine2": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "state": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "zipCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "employeeCount": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "annualRevenue": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "website",
                    "industry",
                    "phone",
                    "contactEmail",
                    "contactName",
                    "address",
                    "addressLine2",
                    "city",
                    "state",
                    "zipCode",
                    "country",
                    "employeeCount",
                    "annualRevenue",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "client.update",
        "summary": "Update a client",
        "description": "Updates one or more profile fields of an existing client in the caller's tenant. A field left out of the request is unchanged; a field sent as null clears it. Reassigning the client's default contact is contact.set_default's job, not this operation's. For a ConnectWise-sourced client with write-back enabled, a value ConnectWise would reject answers conflict and writes nothing; otherwise a queued sync is reported as crmWriteBackEnqueued. A client id outside the tenant or that does not exist answers not_found.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "website": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "address": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addressLine2": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "zipCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a client",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zipCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "employeeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "annualRevenue": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "website",
                        "industry",
                        "phone",
                        "contactEmail",
                        "contactName",
                        "address",
                        "addressLine2",
                        "city",
                        "state",
                        "zipCode",
                        "country",
                        "employeeCount",
                        "annualRevenue",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "crmWriteBackEnqueued": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "client",
                    "crmWriteBackEnqueued"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/summary": {
      "get": {
        "operationId": "client.summary",
        "summary": "Get a client summary",
        "description": "Reads an overview of one client: its profile, how many contacts and open opportunities it has, and its five most recent quotes. The counts are of the rows contact.search and opportunity.search would return, so they never exceed what the same caller can retrieve. A hidden client answers not_found.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client summary",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "employeeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "url",
                        "industry",
                        "employeeCount",
                        "website",
                        "phone",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "openOpportunities": {
                      "type": "number"
                    },
                    "totalContacts": {
                      "type": "number"
                    },
                    "recentQuotes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url": {
                            "type": "string"
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "totalAmount": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "url",
                          "status",
                          "totalAmount",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "client",
                    "openOpportunities",
                    "totalContacts",
                    "recentQuotes"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/brief": {
      "get": {
        "operationId": "client.brief",
        "summary": "Get a client brief",
        "description": "A composed read of what an account manager needs about one client in a single call: the client record, agreements by next renewal, recent service tickets and projects with open work first, sites, contacts with the primary first, open opportunities, a configuration count and sample, and the service health rollup, each with its own freshness timestamp so a caller can flag stale data. Every section applies the same visibility rule its own operation does, so the brief can never return a row that operation refuses. The tickets section carries service records only and the projects section project records only, so neither is a subset of the other. Documentation reports itself unavailable: its source is published to no caller on this deployment. Deterministic from its inputs, and capped rather than paged; a caller needing a full list asks that domain's own operation. Because it composes nine domains, a key must hold every one of their read scopes, not client:read alone. A hidden client answers not_found.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client brief",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zipCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "employeeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "annualRevenue": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "website",
                        "industry",
                        "phone",
                        "contactEmail",
                        "contactName",
                        "address",
                        "addressLine2",
                        "city",
                        "state",
                        "zipCode",
                        "country",
                        "employeeCount",
                        "annualRevenue",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "generatedAt": {
                      "type": "string"
                    },
                    "agreements": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "status": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "startDate": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "endDate": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "renewalDate": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "autoRenewal": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "status",
                              "startDate",
                              "endDate",
                              "renewalDate",
                              "autoRenewal"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "freshness": {
                          "type": "object",
                          "properties": {
                            "asOf": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "asOf"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "items",
                        "freshness"
                      ],
                      "additionalProperties": false
                    },
                    "tickets": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "summary": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "status": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "priority": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "closedFlag": {
                                "type": "boolean"
                              },
                              "dateEntered": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "closedDate": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "summary",
                              "status",
                              "priority",
                              "closedFlag",
                              "dateEntered",
                              "closedDate"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "freshness": {
                          "type": "object",
                          "properties": {
                            "asOf": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "asOf"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "items",
                        "freshness"
                      ],
                      "additionalProperties": false
                    },
                    "projects": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "status": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "ownerName": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "openedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "targetDate": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "closedFlag": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "status",
                              "ownerName",
                              "openedAt",
                              "targetDate",
                              "closedFlag"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "freshness": {
                          "type": "object",
                          "properties": {
                            "asOf": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "asOf"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "items",
                        "freshness"
                      ],
                      "additionalProperties": false
                    },
                    "sites": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "city": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "state": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "isDefault": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "city",
                              "state",
                              "isDefault"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "freshness": {
                          "type": "object",
                          "properties": {
                            "asOf": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "asOf"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "items",
                        "freshness"
                      ],
                      "additionalProperties": false
                    },
                    "contacts": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "email": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "isPrimaryContact": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "title",
                              "email",
                              "isPrimaryContact"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "freshness": {
                          "type": "object",
                          "properties": {
                            "asOf": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "asOf"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "items",
                        "freshness"
                      ],
                      "additionalProperties": false
                    },
                    "opportunities": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "title": {
                                "type": "string"
                              },
                              "status": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "expectedCloseDate": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "title",
                              "status",
                              "expectedCloseDate"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "freshness": {
                          "type": "object",
                          "properties": {
                            "asOf": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "asOf"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "items",
                        "freshness"
                      ],
                      "additionalProperties": false
                    },
                    "configurations": {
                      "type": "object",
                      "properties": {
                        "summary": {
                          "type": "object",
                          "properties": {
                            "totalCount": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "activeCount": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "configurationType": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "status": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "configurationType",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "totalCount",
                            "activeCount",
                            "items"
                          ],
                          "additionalProperties": false
                        },
                        "freshness": {
                          "type": "object",
                          "properties": {
                            "asOf": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "asOf"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "summary",
                        "freshness"
                      ],
                      "additionalProperties": false
                    },
                    "documentation": {
                      "type": "object",
                      "properties": {
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "unavailable"
                          ]
                        },
                        "unavailableReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "title": {
                                "type": "string"
                              },
                              "artifactKind": {
                                "type": "string"
                              },
                              "sourceObservedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "ageDays": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "title",
                              "artifactKind",
                              "sourceObservedAt",
                              "ageDays"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "freshness": {
                          "type": "object",
                          "properties": {
                            "asOf": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "asOf"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "availability",
                        "unavailableReason",
                        "items",
                        "freshness"
                      ],
                      "additionalProperties": false
                    },
                    "serviceHealth": {
                      "type": "object",
                      "properties": {
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "windowStart": {
                          "type": "string"
                        },
                        "windowEnd": {
                          "type": "string"
                        },
                        "narrative": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "headline": {
                                  "type": "string"
                                },
                                "narrative": {
                                  "type": "string"
                                },
                                "recommendedFocus": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "ticketCount": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "windowStart": {
                                  "type": "string"
                                },
                                "windowEnd": {
                                  "type": "string"
                                },
                                "generatedAt": {
                                  "type": "string"
                                },
                                "expiresAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "headline",
                                "narrative",
                                "recommendedFocus",
                                "ticketCount",
                                "windowStart",
                                "windowEnd",
                                "generatedAt",
                                "expiresAt"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rollup": {
                          "type": "object",
                          "properties": {
                            "ticketCount": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "averageSentimentScore": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "sentimentLabelCounts": {
                              "type": "object",
                              "properties": {
                                "positive": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "neutral": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "negative": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "mixed": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "positive",
                                "neutral",
                                "negative",
                                "mixed"
                              ],
                              "additionalProperties": false
                            },
                            "riskFlagCounts": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "latestSentimentScore": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "latestSentimentLabel": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "latestTrajectory": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "trend": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "ticketId": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "dateEntered": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "windowDate": {
                                    "type": "string"
                                  },
                                  "analyzedAt": {
                                    "type": "string"
                                  },
                                  "sentimentScore": {
                                    "type": "number"
                                  },
                                  "sentimentLabel": {
                                    "type": "string"
                                  },
                                  "trajectory": {
                                    "type": "string"
                                  },
                                  "riskFlags": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "ticketId",
                                  "dateEntered",
                                  "windowDate",
                                  "analyzedAt",
                                  "sentimentScore",
                                  "sentimentLabel",
                                  "trajectory",
                                  "riskFlags"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "trendTruncated": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "ticketCount",
                            "averageSentimentScore",
                            "sentimentLabelCounts",
                            "riskFlagCounts",
                            "latestSentimentScore",
                            "latestSentimentLabel",
                            "latestTrajectory",
                            "trend",
                            "trendTruncated"
                          ],
                          "additionalProperties": false
                        },
                        "freshness": {
                          "type": "object",
                          "properties": {
                            "narrativeGeneratedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "rollupComputedAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "narrativeGeneratedAt",
                            "rollupComputedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "clientId",
                        "windowStart",
                        "windowEnd",
                        "narrative",
                        "rollup",
                        "freshness"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "client",
                    "generatedAt",
                    "agreements",
                    "tickets",
                    "projects",
                    "sites",
                    "contacts",
                    "opportunities",
                    "configurations",
                    "documentation",
                    "serviceHealth"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/sentiment": {
      "get": {
        "operationId": "client.sentiment",
        "summary": "Get a client sentiment snapshot",
        "description": "Reads a computed sentiment snapshot for one client: a bucket, a confidence, evidence counts, the top drivers, risk flags and suggested next actions, derived with deterministic local rules from the client's recent CRM activities, opportunities and quotes. All of that text moves the score, but an evidence snippet quotes only text another published read already returns, so an email body, a meeting transcript summary, an opportunity's notes and a quote's description or loss reason are scored and never quoted. Contacts and opportunities are read through the same visibility rules contact.search and opportunity.search apply. A key needs opportunity:read as well as client:read, because the snapshot returns opportunity and quote titles. A hidden client answers not_found.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "windowDays",
            "in": "query",
            "required": false,
            "schema": {
              "default": 90,
              "type": "integer",
              "minimum": 1,
              "maximum": 365
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client sentiment snapshot",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "snapshot": {
                      "type": "object",
                      "properties": {
                        "client": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "name": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "industry": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "website": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "phone": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "url",
                            "industry",
                            "website",
                            "phone"
                          ],
                          "additionalProperties": false
                        },
                        "bucket": {
                          "type": "string",
                          "enum": [
                            "positive",
                            "neutral",
                            "negative",
                            "mixed",
                            "unknown"
                          ]
                        },
                        "confidence": {
                          "type": "number"
                        },
                        "generatedAt": {
                          "type": "string"
                        },
                        "windowDays": {
                          "type": "number"
                        },
                        "reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "evidenceCounts": {
                          "type": "object",
                          "properties": {
                            "activities": {
                              "type": "number"
                            },
                            "usableActivities": {
                              "type": "number"
                            },
                            "opportunities": {
                              "type": "number"
                            },
                            "quotes": {
                              "type": "number"
                            },
                            "positiveSignals": {
                              "type": "number"
                            },
                            "negativeSignals": {
                              "type": "number"
                            },
                            "neutralSignals": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "activities",
                            "usableActivities",
                            "opportunities",
                            "quotes",
                            "positiveSignals",
                            "negativeSignals",
                            "neutralSignals"
                          ],
                          "additionalProperties": false
                        },
                        "topDrivers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "riskFlags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "nextActions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "evidence": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "sourceType": {
                                "type": "string",
                                "enum": [
                                  "activity",
                                  "opportunity",
                                  "quote"
                                ]
                              },
                              "entityType": {
                                "type": "string",
                                "enum": [
                                  "client",
                                  "contact",
                                  "opportunity",
                                  "quote"
                                ]
                              },
                              "entityId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "date": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "snippet": {
                                "type": "string"
                              },
                              "signal": {
                                "type": "string",
                                "enum": [
                                  "positive",
                                  "neutral",
                                  "negative"
                                ]
                              },
                              "score": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "sourceType",
                              "entityType",
                              "entityId",
                              "date",
                              "title",
                              "snippet",
                              "signal",
                              "score"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "client",
                        "bucket",
                        "confidence",
                        "generatedAt",
                        "windowDays",
                        "reason",
                        "evidenceCounts",
                        "topDrivers",
                        "riskFlags",
                        "nextActions",
                        "evidence"
                      ],
                      "additionalProperties": false
                    },
                    "markdown": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "snapshot",
                    "markdown"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/profile": {
      "post": {
        "operationId": "client.profile_update",
        "summary": "Update a client's profile",
        "description": "Updates a client's profile fields, and optionally its primary contact and default location, in one step. A field left out is unchanged; null clears it. A contact or site id that is not this client's answers not_found; a name another active client already has answers conflict. For a ConnectWise-sourced record with write-back enabled, a value ConnectWise would reject answers conflict and writes nothing; otherwise each queued sync is reported in crmWriteBack.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "fields": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "industry": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "employeeCount": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 2147483647
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "address": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "addressLine2": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "city": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "state": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "zipCode": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "country": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "website": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "faxNumber": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "cwCompanyTypes": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  "primaryContact": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "firstName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "lastName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "email": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "title": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      }
                    },
                    "additionalProperties": false
                  },
                  "defaultLocation": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "addressLine1": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "addressLine2": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "city": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "state": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "zip": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "country": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a client's profile",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zipCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "employeeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "annualRevenue": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "website",
                        "industry",
                        "phone",
                        "contactEmail",
                        "contactName",
                        "address",
                        "addressLine2",
                        "city",
                        "state",
                        "zipCode",
                        "country",
                        "employeeCount",
                        "annualRevenue",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "primaryContactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "defaultSiteId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "crmWriteBack": {
                      "type": "object",
                      "properties": {
                        "client": {
                          "type": "boolean"
                        },
                        "primaryContact": {
                          "type": "boolean"
                        },
                        "defaultLocation": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "client",
                        "primaryContact",
                        "defaultLocation"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "client",
                    "primaryContactId",
                    "defaultSiteId",
                    "crmWriteBack"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/default-contact/clear": {
      "post": {
        "operationId": "client.default_contact_clear",
        "summary": "Clear a client's preferred contact",
        "description": "Leaves a client with no preferred contact; the former one is no longer marked primary. A client with none answers cleared: false. A client id outside the tenant, archived, or that does not exist answers not_found.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clear a client's preferred contact",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zipCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "employeeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "annualRevenue": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "website",
                        "industry",
                        "phone",
                        "contactEmail",
                        "contactName",
                        "address",
                        "addressLine2",
                        "city",
                        "state",
                        "zipCode",
                        "country",
                        "employeeCount",
                        "annualRevenue",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "cleared": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "client",
                    "cleared"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/logo": {
      "post": {
        "operationId": "client.logo_set",
        "summary": "Set a client's logo",
        "description": "Records an uploaded image as a client's logo. The file path must be the caller's tenant id, then the client id, then the file name, and the URL must be the HTTPS client-logos storage URL of that same path. A client id outside the tenant, archived, or that does not exist answers not_found.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "logoFilePath": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "logoUrl": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  }
                },
                "required": [
                  "logoFilePath",
                  "logoUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set a client's logo",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zipCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "employeeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "annualRevenue": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "website",
                        "industry",
                        "phone",
                        "contactEmail",
                        "contactName",
                        "address",
                        "addressLine2",
                        "city",
                        "state",
                        "zipCode",
                        "country",
                        "employeeCount",
                        "annualRevenue",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "logoUrl": {
                      "type": "string"
                    },
                    "logoFilePath": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "client",
                    "logoUrl",
                    "logoFilePath"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/logo/clear": {
      "post": {
        "operationId": "client.logo_clear",
        "summary": "Clear a client's logo",
        "description": "Removes a client's logo. A client with none answers the same way. A client id outside the tenant, archived, or that does not exist answers not_found.",
        "tags": [
          "client"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clear a client's logo",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zipCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "employeeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "annualRevenue": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "website",
                        "industry",
                        "phone",
                        "contactEmail",
                        "contactName",
                        "address",
                        "addressLine2",
                        "city",
                        "state",
                        "zipCode",
                        "country",
                        "employeeCount",
                        "annualRevenue",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "client"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/bulk-archive": {
      "post": {
        "operationId": "contact.bulk_archive",
        "summary": "Archive every contact a list filter matches",
        "description": "Archives the active contacts in the caller's tenant that match the contact list's client, search and filters, minus any excluded ids. Each archived contact stops being primary, a client whose preferred contact it was is left without one, and when ConnectWise write-back is on its deletion is queued there. More than 5,000 matches answers validation_failed and archives nothing; narrow the filters and try again.",
        "tags": [
          "contact"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "search": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "filters": {
                    "type": "object",
                    "properties": {
                      "account": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 500
                        }
                      },
                      "title": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 500
                        }
                      },
                      "contactType": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 500
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  "excludedIds": {
                    "maxItems": 5000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Archive every contact a list filter matches",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "archivedCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "archivedCount"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/search": {
      "get": {
        "operationId": "contact.search",
        "summary": "Search contacts",
        "description": "Searches contacts across all clients, or within one client, in the caller's tenant. Matches on name and email. Excluded: a contact that is archived, that every linked source reports removed, that the PSA has marked inactive, and any contact whose client is itself hidden. Each contact's url opens the parent client's page, because contacts have no detail page of their own. Ordered by name with the contact id as tiebreaker and paged with an opaque cursor.",
        "tags": [
          "contact"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search contacts",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phone": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isPrimary": {
                            "type": "boolean"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientName": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "email",
                          "phone",
                          "title",
                          "isPrimary",
                          "clientId",
                          "clientName",
                          "url"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/{contactId}/restore": {
      "post": {
        "operationId": "contact.restore",
        "summary": "Restore an archived contact",
        "description": "Clears one contact's archive in the caller's tenant. Does not restore default or primary status. A contact that is not archived answers with its current state rather than an error, and a contact id outside the tenant or that does not exist answers not_found.",
        "tags": [
          "contact"
        ],
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Restore an archived contact",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "contact": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isPrimary": {
                          "type": "boolean"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email",
                        "phone",
                        "title",
                        "isPrimary",
                        "clientId",
                        "clientName",
                        "url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "contact"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/{contactId}/archive": {
      "post": {
        "operationId": "contact.archive",
        "summary": "Archive a contact",
        "description": "Soft-deletes one contact in the caller's tenant: clears its primary-contact flag, and clears the client's default-contact pointer if this contact held it. A contact that is already archived answers with its current state rather than an error. A contact id outside the tenant or that does not exist answers not_found.",
        "tags": [
          "contact"
        ],
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Archive a contact",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "contact": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isPrimary": {
                          "type": "boolean"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email",
                        "phone",
                        "title",
                        "isPrimary",
                        "clientId",
                        "clientName",
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "defaultContactCleared": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "contact",
                    "defaultContactCleared"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/{contactId}/set-default": {
      "post": {
        "operationId": "contact.set_default",
        "summary": "Set a client's default contact",
        "description": "Makes an existing contact the client's default contact, the one quotes and other commercial workflows fall back to. The previous default contact stops being primary. An archived contact, or a contact whose client is archived, answers conflict and changes nothing. A contact id outside the tenant or that does not exist answers not_found.",
        "tags": [
          "contact"
        ],
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set a client's default contact",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "contact": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isPrimary": {
                          "type": "boolean"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email",
                        "phone",
                        "title",
                        "isPrimary",
                        "clientId",
                        "clientName",
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "contact",
                    "clientId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts": {
      "post": {
        "operationId": "contact.create",
        "summary": "Create a contact",
        "description": "Creates a new contact under a client in the caller's tenant. If the client has no default contact yet, the new contact is promoted to it automatically, best-effort -- a promotion failure does not fail the create. A client id outside the tenant, archived, or that does not exist answers not_found; a site id that does not belong to the same client answers conflict.",
        "tags": [
          "contact"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "firstName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "lastName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "mobilePhone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "title": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "department": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "address": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addressLine2": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "zipCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "linkedinUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "preferredContactMethod": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "doNotContact": {
                    "type": "boolean"
                  },
                  "siteId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contactType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "clientId",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a contact",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "contact": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isPrimary": {
                          "type": "boolean"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email",
                        "phone",
                        "title",
                        "isPrimary",
                        "clientId",
                        "clientName",
                        "url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "contact"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/{contactId}": {
      "post": {
        "operationId": "contact.update",
        "summary": "Update a contact",
        "description": "Updates one or more fields of an existing contact in the caller's tenant. A field left out of the request is unchanged; a field sent as null clears it. Does not change which contact is the client's default. Use contact.set_default for that. Actual edits to ConnectWise-owned fields answer conflict and write nothing unless write-back is enabled and supports every owned edit. A value ConnectWise would reject, an inconsistent derived name, or a write-back request that cannot be accepted also refuses the entire edit. Local preferences and communications without a populated provider value remain writable. Unchanged values do not request write-back. crmWriteBackEnqueued reports whether a ConnectWise update was requested, not whether it has completed. A contact id outside the tenant, archived, or that does not exist answers not_found; a site id that does not belong to the same client answers conflict. avatarUrl must be a link to a photo uploaded for this same contact in the caller's workspace, or null to remove it; it is accepted from a user session only, and an API key that sends it answers forbidden.",
        "tags": [
          "contact"
        ],
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "firstName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "mobilePhone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "title": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "department": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "address": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addressLine2": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "zipCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "linkedinUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "preferredContactMethod": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "doNotContact": {
                    "type": "boolean"
                  },
                  "siteId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contactType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "avatarUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2048
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a contact",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "contact": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isPrimary": {
                          "type": "boolean"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email",
                        "phone",
                        "title",
                        "isPrimary",
                        "clientId",
                        "clientName",
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "crmWriteBackEnqueued": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "contact",
                    "crmWriteBackEnqueued"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "contact.get",
        "summary": "Get a contact",
        "description": "Reads one active contact in the caller's tenant with its client: the split name, every phone and email, the address, department, contact preferences and defaults. An archived contact, one whose client is hidden, and one in another tenant answer not_found. PSA mirror ids, private phone numbers, custom fields and sync bookkeeping are null for an API key.",
        "tags": [
          "contact"
        ],
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a contact",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "contact": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "tenantId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "nickName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "mobilePhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "directPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "department": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactTypeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "linkedinUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "doNotContact": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "preferredContactMethod": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "emailSourceStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatarUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zipCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "systemLocationId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "systemLocationKind": {
                          "type": "string"
                        },
                        "managerContactId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "assistantContactId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "isPrimaryContact": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "isDefaultBillingContact": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "isDefaultCompanyContact": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "relationshipOverride": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "sourcePresence": {
                          "type": "string"
                        },
                        "cwInactiveFlag": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "cwRelationship": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cwContactTypes": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseContactId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseSiteId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cwCompanyLocationId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cwManagerContactId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cwAssistantContactId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "haloContactId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "itglueContactId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connectwiseSyncStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "haloSyncStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "crmWritebackRevision": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseCreateRequested": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "connectwiseDeleteRequested": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "communicationItems": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "customFields": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "lastSyncedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "externalUpdatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastSeenAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastSeenPsaSyncJobId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "orphanedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdBy": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "archivedBy": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "archivedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "client": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id",
                        "tenantId",
                        "clientId",
                        "clientName",
                        "name",
                        "firstName",
                        "lastName",
                        "nickName",
                        "email",
                        "phone",
                        "mobilePhone",
                        "directPhone",
                        "title",
                        "department",
                        "contactType",
                        "contactTypeId",
                        "linkedinUrl",
                        "doNotContact",
                        "preferredContactMethod",
                        "emailSourceStatus",
                        "avatarUrl",
                        "address",
                        "addressLine2",
                        "city",
                        "state",
                        "zipCode",
                        "country",
                        "siteId",
                        "systemLocationId",
                        "systemLocationKind",
                        "managerContactId",
                        "assistantContactId",
                        "isPrimaryContact",
                        "isDefaultBillingContact",
                        "isDefaultCompanyContact",
                        "relationshipOverride",
                        "sourcePresence",
                        "cwInactiveFlag",
                        "cwRelationship",
                        "cwContactTypes",
                        "connectwiseContactId",
                        "connectwiseSiteId",
                        "cwCompanyLocationId",
                        "cwManagerContactId",
                        "cwAssistantContactId",
                        "haloContactId",
                        "itglueContactId",
                        "connectwiseSyncStatus",
                        "haloSyncStatus",
                        "crmWritebackRevision",
                        "connectwiseCreateRequested",
                        "connectwiseDeleteRequested",
                        "communicationItems",
                        "customFields",
                        "lastSyncedAt",
                        "externalUpdatedAt",
                        "lastSeenAt",
                        "lastSeenPsaSyncJobId",
                        "orphanedAt",
                        "createdBy",
                        "archivedBy",
                        "archivedAt",
                        "createdAt",
                        "updatedAt",
                        "client"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "contact"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/filter-options": {
      "get": {
        "operationId": "contact.filter_options",
        "summary": "List the contact roster's filter options",
        "description": "Lists the distinct contact types, titles and client names across the caller's contacts, or one client's, for the contact roster's filter menus. A client outside the tenant answers not_found.",
        "tags": [
          "contact"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List the contact roster's filter options",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "contactTypes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "titles": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "contactTypes",
                    "titles",
                    "accounts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/roster": {
      "get": {
        "operationId": "opportunity.roster",
        "summary": "Page through the opportunity roster",
        "description": "Pages through the opportunities in the caller's tenant as the Opportunities screen lists them, most recently updated first unless sorted by creation time, with the id as tiebreaker, paged with an opaque cursor. Search matches title and description; stage, owner and status narrow the list, and status is not filtered unless asked for. Each row is the same record opportunity.detail returns. An opportunity whose client is hidden, and one the PSA no longer backs, are excluded. customFields, the ConnectWise write-back status and error, and the client's logo and ConnectWise id are null for an API key.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "stageId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "deleted",
                "open"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "-updatedAt",
                "-createdAt"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page through the opportunity roster",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "tenantId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientName": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "contactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "billingContactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "shippingContactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "siteId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "stageId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "ownerId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "opportunityTypeId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "linkedQuoteId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "probability": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expectedCloseDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "actualCloseDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "forecastedValueServices": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedValueProducts": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedValueRecurring": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedTcv": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedMrr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedArr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonValueServices": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonValueProducts": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonValueRecurring": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonTcv": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonMrr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonArr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostValueServices": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostValueProducts": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostValueRecurring": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostTcv": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostMrr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostArr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "businessUnit": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "decisionCriteria": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "timelineNotes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "notes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tags": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "customFields": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "primarySalesRepId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "primarySalesRepName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "secondarySalesRepId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "secondarySalesRepName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectwiseOpportunityId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "haloOpportunityId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "connectwiseSyncStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectwiseWritebackStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectwiseWritebackError": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "updatedBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "opportunityType": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "stage": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "tenantId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "stageOrder": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "color": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "icon": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "isDefault": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "isClosedWon": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "isClosedLost": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "isArchived": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "archivedReason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "source": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sourceIntegrationId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "createdAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "updatedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "description",
                              "stageOrder",
                              "color",
                              "icon",
                              "isDefault",
                              "isClosedWon",
                              "isClosedLost",
                              "isArchived",
                              "archivedReason",
                              "source",
                              "sourceIntegrationId",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          },
                          "client": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "logoUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "connectwiseAccountId": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "logoUrl",
                              "connectwiseAccountId"
                            ],
                            "additionalProperties": false
                          },
                          "owner": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "firstName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "lastName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "firstName",
                                  "lastName",
                                  "email"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "contact": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "phone": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "email",
                                  "phone"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "billingContact": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "phone": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "email",
                                  "phone"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "shippingContact": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "phone": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "email",
                                  "phone"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "site": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "clientId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "format": "uuid",
                                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "addressLine1": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "addressLine2": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "city": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "state": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "zip": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "country": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "clientId",
                                  "addressLine1",
                                  "addressLine2",
                                  "city",
                                  "state",
                                  "zip",
                                  "country"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "tenantId",
                          "title",
                          "description",
                          "status",
                          "clientId",
                          "clientName",
                          "tenantName",
                          "contactId",
                          "billingContactId",
                          "shippingContactId",
                          "siteId",
                          "stageId",
                          "ownerId",
                          "opportunityTypeId",
                          "linkedQuoteId",
                          "probability",
                          "expectedCloseDate",
                          "actualCloseDate",
                          "forecastedValueServices",
                          "forecastedValueProducts",
                          "forecastedValueRecurring",
                          "forecastedTcv",
                          "forecastedMrr",
                          "forecastedArr",
                          "wonValueServices",
                          "wonValueProducts",
                          "wonValueRecurring",
                          "wonTcv",
                          "wonMrr",
                          "wonArr",
                          "lostValueServices",
                          "lostValueProducts",
                          "lostValueRecurring",
                          "lostTcv",
                          "lostMrr",
                          "lostArr",
                          "businessUnit",
                          "source",
                          "decisionCriteria",
                          "timelineNotes",
                          "notes",
                          "tags",
                          "customFields",
                          "primarySalesRepId",
                          "primarySalesRepName",
                          "secondarySalesRepId",
                          "secondarySalesRepName",
                          "connectwiseOpportunityId",
                          "haloOpportunityId",
                          "connectwiseSyncStatus",
                          "connectwiseWritebackStatus",
                          "connectwiseWritebackError",
                          "createdBy",
                          "updatedBy",
                          "createdAt",
                          "updatedAt",
                          "opportunityType",
                          "stage",
                          "client",
                          "owner",
                          "contact",
                          "billingContact",
                          "shippingContact",
                          "site"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/probability-options": {
      "get": {
        "operationId": "opportunity.probability_options",
        "summary": "List the tenant's ConnectWise opportunity probabilities",
        "description": "Lists the probability values ConnectWise accepts for the caller's tenant, lowest first, and whether an active ConnectWise integration exists. An empty list with connected false means free-form probability is correct; with connected true the vocabulary has not synced.",
        "tags": [
          "opportunity"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "List the tenant's ConnectWise opportunity probabilities",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "probabilities": {
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                      }
                    },
                    "connected": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "probabilities",
                    "connected"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/{opportunityId}/detail": {
      "get": {
        "operationId": "opportunity.detail",
        "summary": "Get an opportunity record",
        "description": "Reads one opportunity in the caller's tenant as the opportunity page renders it: every forecast, won and lost value, the sales reps, and the joined stage, client, owner, contacts, site and type. An id in another tenant, on a hidden client, or that the PSA no longer backs answers not_found. customFields, the ConnectWise write-back status and error, and the client's logo and ConnectWise id are null for an API key.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "opportunityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get an opportunity record",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "opportunity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "tenantId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "tenantName": {
                          "type": "string"
                        },
                        "contactId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "billingContactId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shippingContactId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "stageId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "ownerId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "opportunityTypeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "linkedQuoteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expectedCloseDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "actualCloseDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "forecastedValueServices": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "forecastedValueProducts": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "forecastedValueRecurring": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "forecastedTcv": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "forecastedMrr": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "forecastedArr": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wonValueServices": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wonValueProducts": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wonValueRecurring": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wonTcv": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wonMrr": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wonArr": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "lostValueServices": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "lostValueProducts": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "lostValueRecurring": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "lostTcv": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "lostMrr": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "lostArr": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "businessUnit": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "source": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "decisionCriteria": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "timelineNotes": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "notes": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "tags": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "customFields": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "primarySalesRepId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "primarySalesRepName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "secondarySalesRepId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "secondarySalesRepName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "haloOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseSyncStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connectwiseWritebackStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connectwiseWritebackError": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdBy": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "updatedBy": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityType": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "stage": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "tenantId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "stageOrder": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "color": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "icon": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "isDefault": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "isClosedWon": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "isClosedLost": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "isArchived": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "archivedReason": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "source": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sourceIntegrationId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "updatedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "description",
                            "stageOrder",
                            "color",
                            "icon",
                            "isDefault",
                            "isClosedWon",
                            "isClosedLost",
                            "isArchived",
                            "archivedReason",
                            "source",
                            "sourceIntegrationId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "client": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "name": {
                              "type": "string"
                            },
                            "logoUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "connectwiseAccountId": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "logoUrl",
                            "connectwiseAccountId"
                          ],
                          "additionalProperties": false
                        },
                        "owner": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "firstName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "lastName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "email": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "firstName",
                                "lastName",
                                "email"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "contact": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "email": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "phone": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "email",
                                "phone"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "billingContact": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "email": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "phone": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "email",
                                "phone"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shippingContact": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "email": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "phone": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "email",
                                "phone"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "site": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "clientId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "addressLine1": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "addressLine2": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "city": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "state": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "zip": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "country": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "clientId",
                                "addressLine1",
                                "addressLine2",
                                "city",
                                "state",
                                "zip",
                                "country"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "tenantId",
                        "title",
                        "description",
                        "status",
                        "clientId",
                        "clientName",
                        "tenantName",
                        "contactId",
                        "billingContactId",
                        "shippingContactId",
                        "siteId",
                        "stageId",
                        "ownerId",
                        "opportunityTypeId",
                        "linkedQuoteId",
                        "probability",
                        "expectedCloseDate",
                        "actualCloseDate",
                        "forecastedValueServices",
                        "forecastedValueProducts",
                        "forecastedValueRecurring",
                        "forecastedTcv",
                        "forecastedMrr",
                        "forecastedArr",
                        "wonValueServices",
                        "wonValueProducts",
                        "wonValueRecurring",
                        "wonTcv",
                        "wonMrr",
                        "wonArr",
                        "lostValueServices",
                        "lostValueProducts",
                        "lostValueRecurring",
                        "lostTcv",
                        "lostMrr",
                        "lostArr",
                        "businessUnit",
                        "source",
                        "decisionCriteria",
                        "timelineNotes",
                        "notes",
                        "tags",
                        "customFields",
                        "primarySalesRepId",
                        "primarySalesRepName",
                        "secondarySalesRepId",
                        "secondarySalesRepName",
                        "connectwiseOpportunityId",
                        "haloOpportunityId",
                        "connectwiseSyncStatus",
                        "connectwiseWritebackStatus",
                        "connectwiseWritebackError",
                        "createdBy",
                        "updatedBy",
                        "createdAt",
                        "updatedAt",
                        "opportunityType",
                        "stage",
                        "client",
                        "owner",
                        "contact",
                        "billingContact",
                        "shippingContact",
                        "site"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "opportunity"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/opportunities": {
      "get": {
        "operationId": "opportunity.list",
        "summary": "List a client's opportunities",
        "description": "Lists one client's opportunities in the caller's tenant, newest first by creation time with the id as tiebreaker, paged with an opaque cursor (default page 50). Each row is the same record opportunity.detail returns. A client in another tenant answers not_found; an archived client answers an empty page.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's opportunities",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "tenantId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientName": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "contactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "billingContactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "shippingContactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "siteId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "stageId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "ownerId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "opportunityTypeId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "linkedQuoteId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "probability": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expectedCloseDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "actualCloseDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "forecastedValueServices": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedValueProducts": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedValueRecurring": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedTcv": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedMrr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "forecastedArr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonValueServices": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonValueProducts": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonValueRecurring": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonTcv": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonMrr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "wonArr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostValueServices": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostValueProducts": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostValueRecurring": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostTcv": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostMrr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lostArr": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "businessUnit": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "decisionCriteria": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "timelineNotes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "notes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tags": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "customFields": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "primarySalesRepId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "primarySalesRepName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "secondarySalesRepId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "secondarySalesRepName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectwiseOpportunityId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "haloOpportunityId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "connectwiseSyncStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectwiseWritebackStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectwiseWritebackError": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "updatedBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "opportunityType": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "stage": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "tenantId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "stageOrder": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "color": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "icon": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "isDefault": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "isClosedWon": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "isClosedLost": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "isArchived": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "archivedReason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "source": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sourceIntegrationId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "createdAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "updatedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "description",
                              "stageOrder",
                              "color",
                              "icon",
                              "isDefault",
                              "isClosedWon",
                              "isClosedLost",
                              "isArchived",
                              "archivedReason",
                              "source",
                              "sourceIntegrationId",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          },
                          "client": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "logoUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "connectwiseAccountId": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "logoUrl",
                              "connectwiseAccountId"
                            ],
                            "additionalProperties": false
                          },
                          "owner": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "firstName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "lastName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "firstName",
                                  "lastName",
                                  "email"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "contact": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "phone": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "email",
                                  "phone"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "billingContact": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "phone": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "email",
                                  "phone"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "shippingContact": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "phone": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "email",
                                  "phone"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "site": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "clientId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "format": "uuid",
                                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "addressLine1": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "addressLine2": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "city": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "state": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "zip": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "country": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "clientId",
                                  "addressLine1",
                                  "addressLine2",
                                  "city",
                                  "state",
                                  "zip",
                                  "country"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "tenantId",
                          "title",
                          "description",
                          "status",
                          "clientId",
                          "clientName",
                          "tenantName",
                          "contactId",
                          "billingContactId",
                          "shippingContactId",
                          "siteId",
                          "stageId",
                          "ownerId",
                          "opportunityTypeId",
                          "linkedQuoteId",
                          "probability",
                          "expectedCloseDate",
                          "actualCloseDate",
                          "forecastedValueServices",
                          "forecastedValueProducts",
                          "forecastedValueRecurring",
                          "forecastedTcv",
                          "forecastedMrr",
                          "forecastedArr",
                          "wonValueServices",
                          "wonValueProducts",
                          "wonValueRecurring",
                          "wonTcv",
                          "wonMrr",
                          "wonArr",
                          "lostValueServices",
                          "lostValueProducts",
                          "lostValueRecurring",
                          "lostTcv",
                          "lostMrr",
                          "lostArr",
                          "businessUnit",
                          "source",
                          "decisionCriteria",
                          "timelineNotes",
                          "notes",
                          "tags",
                          "customFields",
                          "primarySalesRepId",
                          "primarySalesRepName",
                          "secondarySalesRepId",
                          "secondarySalesRepName",
                          "connectwiseOpportunityId",
                          "haloOpportunityId",
                          "connectwiseSyncStatus",
                          "connectwiseWritebackStatus",
                          "connectwiseWritebackError",
                          "createdBy",
                          "updatedBy",
                          "createdAt",
                          "updatedAt",
                          "opportunityType",
                          "stage",
                          "client",
                          "owner",
                          "contact",
                          "billingContact",
                          "shippingContact",
                          "site"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/quote-status-sync": {
      "post": {
        "operationId": "opportunity.quote_status_sync",
        "summary": "Move an opportunity to match its quote's status",
        "description": "Moves the opportunity linked to one of the caller's tenant's quotes to the stage and probability its status implies: sent to the quote stage at 75%, approved or signed to closed won at 100%, rejected or expired to closed lost at 0%. Answers the opportunity moved, or null when nothing changed. A quote outside the tenant answers not_found. Requires edit_existing_opportunities.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "quoteId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "quoteStatus": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "required": [
                  "quoteId",
                  "quoteStatus"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Move an opportunity to match its quote's status",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "opportunityId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "opportunityId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/{opportunityId}/linked-quote": {
      "get": {
        "operationId": "opportunity.linked_quote_get",
        "summary": "Get an opportunity's linked quote",
        "description": "Reads the quote linked to one opportunity in the caller's tenant, or null when none is linked. An opportunity outside the tenant, on a hidden client, or that the PSA no longer backs answers not_found.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "opportunityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get an opportunity's linked quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "title": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "totalAmount": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "value": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "createdAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "updatedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "title",
                            "status",
                            "totalAmount",
                            "value",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "quote"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/{opportunityId}/quote": {
      "post": {
        "operationId": "opportunity.quote_create",
        "summary": "Create a quote from an opportunity",
        "description": "Creates a draft quote seeded from one opportunity in the caller's tenant, links it, and moves the opportunity to the workspace's first quote or proposal stage at 75% probability when one exists. These changes succeed or fail together. An opportunity outside the tenant answers not_found; one that already has a linked quote answers conflict. Requires create_quotes, edit_existing_opportunities and change_quote_pricing.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "opportunityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a quote from an opportunity",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "quoteId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/{opportunityId}/quote-link": {
      "post": {
        "operationId": "opportunity.quote_link",
        "summary": "Link a quote to an opportunity",
        "description": "Points one opportunity in the caller's tenant at one of the tenant's quotes. An opportunity or quote outside the tenant answers not_found. Requires edit_existing_opportunities.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "opportunityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "quoteId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "quoteId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Link a quote to an opportunity",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "opportunityId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "opportunityId",
                    "quoteId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/{opportunityId}/quote-unlink": {
      "post": {
        "operationId": "opportunity.quote_unlink",
        "summary": "Unlink a quote from an opportunity",
        "description": "Clears the link between one opportunity and one quote in the caller's tenant, on both records. If the opportunity has another quote, it becomes the linked one. An opportunity or quote outside the tenant answers not_found. Requires edit_existing_opportunities.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "opportunityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "quoteId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "quoteId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Unlink a quote from an opportunity",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "unlinked": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "unlinked"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/search": {
      "get": {
        "operationId": "opportunity.search",
        "summary": "Search opportunities",
        "description": "Searches opportunities in the caller's tenant by name, status, or client. An opportunity whose client is hidden, and one the PSA no longer backs, are excluded; status is not filtered unless asked for, so an archived or deleted opportunity is returned until the caller narrows it. Ordered newest first by creation time with the opportunity id as tiebreaker and paged with an opaque cursor.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "deleted",
                "open"
              ]
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search opportunities",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "stageId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "estimatedValue": {
                            "type": "number"
                          },
                          "closeDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientName": {
                            "type": "string"
                          },
                          "clientId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "clientUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "url",
                          "status",
                          "stage",
                          "stageId",
                          "estimatedValue",
                          "closeDate",
                          "clientName",
                          "clientId",
                          "clientUrl",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/metrics": {
      "get": {
        "operationId": "opportunity.metrics",
        "summary": "Get opportunity pipeline metrics",
        "description": "Computes win rate, average deal size, average time to close and a per-stage value distribution over the caller's tenant's active, PSA-present opportunities, optionally narrowed to a created-at date range. Every pipeline stage lists in stageDistribution even when no opportunity in range is in it, at zero.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get opportunity pipeline metrics",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalOpportunities": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "totalValue": {
                      "type": "number"
                    },
                    "avgDealSize": {
                      "type": "number"
                    },
                    "avgTimeToClose": {
                      "type": "number"
                    },
                    "winRate": {
                      "type": "number"
                    },
                    "lossRate": {
                      "type": "number"
                    },
                    "activeOpportunities": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "closedWonOpportunities": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "closedLostOpportunities": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "pipelineValue": {
                      "type": "number"
                    },
                    "stageDistribution": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "stageId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "stageName": {
                            "type": "string"
                          },
                          "stageColor": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "totalValue": {
                            "type": "number"
                          },
                          "averageValue": {
                            "type": "number"
                          },
                          "averageDaysInStage": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "stageId",
                          "stageName",
                          "stageColor",
                          "count",
                          "totalValue",
                          "averageValue",
                          "averageDaysInStage"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "totalOpportunities",
                    "totalValue",
                    "avgDealSize",
                    "avgTimeToClose",
                    "winRate",
                    "lossRate",
                    "activeOpportunities",
                    "closedWonOpportunities",
                    "closedLostOpportunities",
                    "pipelineValue",
                    "stageDistribution"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/{opportunityId}": {
      "get": {
        "operationId": "opportunity.get",
        "summary": "Get an opportunity",
        "description": "Reads one opportunity by id, with its description, value, timeline and the quotes raised against it. An id belonging to another tenant, to a hidden client, or to an opportunity the PSA no longer backs answers not_found; existence is never leaked.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "opportunityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get an opportunity",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "stageId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "estimatedValue": {
                      "type": "number"
                    },
                    "closeDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "clientName": {
                      "type": "string"
                    },
                    "clientId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "clientUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "quotes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url": {
                            "type": "string"
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "totalAmount": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "url",
                          "status",
                          "totalAmount",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "url",
                    "status",
                    "stage",
                    "stageId",
                    "estimatedValue",
                    "closeDate",
                    "clientName",
                    "clientId",
                    "clientUrl",
                    "createdAt",
                    "description",
                    "quotes",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "opportunity.update",
        "summary": "Update an opportunity",
        "description": "Updates an existing opportunity. stageId takes priority over stage (a name, matched case-insensitively). Sending status won or lost selects the workspace's matching closed stage and leaves the opportunity's status field unchanged. value sets the total and the services forecast together and cannot be combined with forecastedValueServices. null clears the description, notes, source, business unit, decision criteria, timeline notes, tags, close date, site or a contact. Moving the opportunity to another client clears its site unless a site of the new client is given, and is refused with conflict for an opportunity ConnectWise holds, which is moved in ConnectWise. An opportunity id outside the tenant, on an archived client, or that does not exist answers not_found, as does a client, contact or site id outside the tenant or a site that is not the client's; giving no field to change answers validation_failed. customFields can only be set from a signed-in session. A stage change starts the workspace's stage-changed workflows, and a change to the name, close date, contact, site, probability or description of an opportunity ConnectWise holds is queued for ConnectWise; connectwiseWriteBack says what was queued and which fields ConnectWise could not take. record is the full opportunity for a signed-in caller and null for an API key.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "opportunityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "value": {
                    "type": "number",
                    "minimum": 0
                  },
                  "stageId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "stage": {
                    "type": "string",
                    "minLength": 1
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "archived",
                      "deleted",
                      "open",
                      "won",
                      "lost"
                    ]
                  },
                  "notes": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "contactId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "siteId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billingContactId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "shippingContactId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "probability": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "forecastedValueServices": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 9999999999.99
                  },
                  "forecastedValueProducts": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 9999999999.99
                  },
                  "forecastedValueRecurring": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 9999999999.99
                  },
                  "expectedCloseDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "businessUnit": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "decisionCriteria": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "timelineNotes": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tags": {
                    "anyOf": [
                      {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "customFields": {
                    "anyOf": [
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update an opportunity",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "opportunity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        },
                        "stageId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "estimatedValue": {
                          "type": "number"
                        },
                        "closeDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "clientId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "url",
                        "status",
                        "stage",
                        "stageId",
                        "estimatedValue",
                        "closeDate",
                        "clientName",
                        "clientId",
                        "clientUrl",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "record": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "tenantId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "title": {
                              "type": "string"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "clientId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "clientName": {
                              "type": "string"
                            },
                            "tenantName": {
                              "type": "string"
                            },
                            "contactId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billingContactId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "shippingContactId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "siteId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "stageId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "ownerId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "opportunityTypeId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "linkedQuoteId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "probability": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "expectedCloseDate": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "actualCloseDate": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "forecastedValueServices": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedValueProducts": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedValueRecurring": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedTcv": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedMrr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedArr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonValueServices": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonValueProducts": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonValueRecurring": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonTcv": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonMrr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonArr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostValueServices": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostValueProducts": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostValueRecurring": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostTcv": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostMrr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostArr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "businessUnit": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "source": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "decisionCriteria": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "timelineNotes": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "notes": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "tags": {
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "customFields": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "primarySalesRepId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "primarySalesRepName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "secondarySalesRepId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "secondarySalesRepName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "connectwiseOpportunityId": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "haloOpportunityId": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "connectwiseSyncStatus": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "connectwiseWritebackStatus": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "connectwiseWritebackError": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "createdBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "updatedBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "updatedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "opportunityType": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "stage": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "tenantId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "stageOrder": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "color": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "icon": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "isDefault": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "isClosedWon": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "isClosedLost": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "isArchived": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "archivedReason": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "source": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "sourceIntegrationId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "createdAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "updatedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "name",
                                "description",
                                "stageOrder",
                                "color",
                                "icon",
                                "isDefault",
                                "isClosedWon",
                                "isClosedLost",
                                "isArchived",
                                "archivedReason",
                                "source",
                                "sourceIntegrationId",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "client": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "logoUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "connectwiseAccountId": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "logoUrl",
                                "connectwiseAccountId"
                              ],
                              "additionalProperties": false
                            },
                            "owner": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "firstName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "lastName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "email": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "firstName",
                                    "lastName",
                                    "email"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "contact": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "email": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phone": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "email",
                                    "phone"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billingContact": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "email": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phone": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "email",
                                    "phone"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "shippingContact": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "email": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phone": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "email",
                                    "phone"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "site": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "clientId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "format": "uuid",
                                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "addressLine1": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "addressLine2": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "city": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "state": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "zip": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "country": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "clientId",
                                    "addressLine1",
                                    "addressLine2",
                                    "city",
                                    "state",
                                    "zip",
                                    "country"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "title",
                            "description",
                            "status",
                            "clientId",
                            "clientName",
                            "tenantName",
                            "contactId",
                            "billingContactId",
                            "shippingContactId",
                            "siteId",
                            "stageId",
                            "ownerId",
                            "opportunityTypeId",
                            "linkedQuoteId",
                            "probability",
                            "expectedCloseDate",
                            "actualCloseDate",
                            "forecastedValueServices",
                            "forecastedValueProducts",
                            "forecastedValueRecurring",
                            "forecastedTcv",
                            "forecastedMrr",
                            "forecastedArr",
                            "wonValueServices",
                            "wonValueProducts",
                            "wonValueRecurring",
                            "wonTcv",
                            "wonMrr",
                            "wonArr",
                            "lostValueServices",
                            "lostValueProducts",
                            "lostValueRecurring",
                            "lostTcv",
                            "lostMrr",
                            "lostArr",
                            "businessUnit",
                            "source",
                            "decisionCriteria",
                            "timelineNotes",
                            "notes",
                            "tags",
                            "customFields",
                            "primarySalesRepId",
                            "primarySalesRepName",
                            "secondarySalesRepId",
                            "secondarySalesRepName",
                            "connectwiseOpportunityId",
                            "haloOpportunityId",
                            "connectwiseSyncStatus",
                            "connectwiseWritebackStatus",
                            "connectwiseWritebackError",
                            "createdBy",
                            "updatedBy",
                            "createdAt",
                            "updatedAt",
                            "opportunityType",
                            "stage",
                            "client",
                            "owner",
                            "contact",
                            "billingContact",
                            "shippingContact",
                            "site"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "connectwiseWriteBack": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "queued",
                            "already_queued",
                            "nothing_to_send",
                            "client_not_linked",
                            "opportunity_not_linked",
                            "not_connected",
                            "refused"
                          ]
                        },
                        "skippedFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "status",
                        "skippedFields",
                        "reason"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "opportunity",
                    "record",
                    "connectwiseWriteBack"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities": {
      "post": {
        "operationId": "opportunity.create",
        "summary": "Create an opportunity",
        "description": "Creates a new opportunity for a client in the caller's tenant, always at status active, owned by the signed-in caller. stageId takes priority over stage (a name, matched case-insensitively); with neither, the workspace's default pipeline stage is used, or its first stage when no default is set. A stageId that is not one of the workspace's active stages answers conflict and creates nothing. value sets the total and the services forecast together; the three forecastedValue fields set the services, products and recurring forecasts on their own, and value cannot be combined with forecastedValueServices. A client id outside the tenant, archived, or that does not exist answers not_found, as does a contactId that does not belong to the given client, a siteId that is not an active site of that client, and a billing or shipping contact outside the tenant. customFields can only be set from a signed-in session. Creating an opportunity starts the workspace's opportunity-created workflows and, when the client is linked to ConnectWise, queues the opportunity for ConnectWise; connectwiseWriteBack says what was queued, and names a refusal when ConnectWise would reject the opportunity for lacking a sales rep or a synced contact. record is the full opportunity for a signed-in caller and null for an API key.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "value": {
                    "type": "number",
                    "minimum": 0
                  },
                  "stageId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "stage": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1
                  },
                  "contactId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "siteId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "billingContactId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "shippingContactId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "probability": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "forecastedValueServices": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 9999999999.99
                  },
                  "forecastedValueProducts": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 9999999999.99
                  },
                  "forecastedValueRecurring": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 9999999999.99
                  },
                  "expectedCloseDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "businessUnit": {
                    "type": "string",
                    "minLength": 1
                  },
                  "source": {
                    "type": "string",
                    "minLength": 1
                  },
                  "decisionCriteria": {
                    "type": "string",
                    "minLength": 1
                  },
                  "timelineNotes": {
                    "type": "string",
                    "minLength": 1
                  },
                  "notes": {
                    "type": "string",
                    "minLength": 1
                  },
                  "tags": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "customFields": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "clientId",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create an opportunity",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "opportunity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        },
                        "stageId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "estimatedValue": {
                          "type": "number"
                        },
                        "closeDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "clientId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "url",
                        "status",
                        "stage",
                        "stageId",
                        "estimatedValue",
                        "closeDate",
                        "clientName",
                        "clientId",
                        "clientUrl",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "record": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "tenantId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "title": {
                              "type": "string"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "clientId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "clientName": {
                              "type": "string"
                            },
                            "tenantName": {
                              "type": "string"
                            },
                            "contactId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billingContactId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "shippingContactId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "siteId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "stageId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "ownerId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "opportunityTypeId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "linkedQuoteId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "probability": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "expectedCloseDate": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "actualCloseDate": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "forecastedValueServices": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedValueProducts": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedValueRecurring": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedTcv": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedMrr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "forecastedArr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonValueServices": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonValueProducts": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonValueRecurring": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonTcv": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonMrr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "wonArr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostValueServices": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostValueProducts": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostValueRecurring": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostTcv": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostMrr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lostArr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "businessUnit": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "source": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "decisionCriteria": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "timelineNotes": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "notes": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "tags": {
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "customFields": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "primarySalesRepId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "primarySalesRepName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "secondarySalesRepId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "secondarySalesRepName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "connectwiseOpportunityId": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "haloOpportunityId": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "connectwiseSyncStatus": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "connectwiseWritebackStatus": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "connectwiseWritebackError": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "createdBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "updatedBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "updatedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "opportunityType": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "stage": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "tenantId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "stageOrder": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "color": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "icon": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "isDefault": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "isClosedWon": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "isClosedLost": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "isArchived": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "archivedReason": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "source": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "sourceIntegrationId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "createdAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "updatedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "name",
                                "description",
                                "stageOrder",
                                "color",
                                "icon",
                                "isDefault",
                                "isClosedWon",
                                "isClosedLost",
                                "isArchived",
                                "archivedReason",
                                "source",
                                "sourceIntegrationId",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "client": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "logoUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "connectwiseAccountId": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "logoUrl",
                                "connectwiseAccountId"
                              ],
                              "additionalProperties": false
                            },
                            "owner": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "firstName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "lastName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "email": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "firstName",
                                    "lastName",
                                    "email"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "contact": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "email": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phone": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "email",
                                    "phone"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billingContact": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "email": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phone": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "email",
                                    "phone"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "shippingContact": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "email": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phone": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "email",
                                    "phone"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "site": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "clientId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "format": "uuid",
                                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "addressLine1": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "addressLine2": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "city": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "state": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "zip": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "country": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "clientId",
                                    "addressLine1",
                                    "addressLine2",
                                    "city",
                                    "state",
                                    "zip",
                                    "country"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "title",
                            "description",
                            "status",
                            "clientId",
                            "clientName",
                            "tenantName",
                            "contactId",
                            "billingContactId",
                            "shippingContactId",
                            "siteId",
                            "stageId",
                            "ownerId",
                            "opportunityTypeId",
                            "linkedQuoteId",
                            "probability",
                            "expectedCloseDate",
                            "actualCloseDate",
                            "forecastedValueServices",
                            "forecastedValueProducts",
                            "forecastedValueRecurring",
                            "forecastedTcv",
                            "forecastedMrr",
                            "forecastedArr",
                            "wonValueServices",
                            "wonValueProducts",
                            "wonValueRecurring",
                            "wonTcv",
                            "wonMrr",
                            "wonArr",
                            "lostValueServices",
                            "lostValueProducts",
                            "lostValueRecurring",
                            "lostTcv",
                            "lostMrr",
                            "lostArr",
                            "businessUnit",
                            "source",
                            "decisionCriteria",
                            "timelineNotes",
                            "notes",
                            "tags",
                            "customFields",
                            "primarySalesRepId",
                            "primarySalesRepName",
                            "secondarySalesRepId",
                            "secondarySalesRepName",
                            "connectwiseOpportunityId",
                            "haloOpportunityId",
                            "connectwiseSyncStatus",
                            "connectwiseWritebackStatus",
                            "connectwiseWritebackError",
                            "createdBy",
                            "updatedBy",
                            "createdAt",
                            "updatedAt",
                            "opportunityType",
                            "stage",
                            "client",
                            "owner",
                            "contact",
                            "billingContact",
                            "shippingContact",
                            "site"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "connectwiseWriteBack": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "queued",
                            "already_queued",
                            "nothing_to_send",
                            "client_not_linked",
                            "opportunity_not_linked",
                            "not_connected",
                            "refused"
                          ]
                        },
                        "skippedFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "status",
                        "skippedFields",
                        "reason"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "opportunity",
                    "record",
                    "connectwiseWriteBack"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/configurations/search": {
      "get": {
        "operationId": "configuration.search",
        "summary": "Search configurations",
        "description": "Searches one client's configurations and assets by name, device/serial/tag identifier, type, or status. A client that is hidden answers not_found rather than an empty list, and a configuration every linked source reports as removed is excluded. Ordered by configuration name with the configuration id as tiebreaker and paged with an opaque cursor.",
        "tags": [
          "configuration"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search configurations",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientName": {
                            "type": "string"
                          },
                          "clientUrl": {
                            "type": "string"
                          },
                          "deviceIdentifier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ipAddress": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "serialNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tagNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "siteName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "location": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "manufacturer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "modelNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status",
                          "description",
                          "clientId",
                          "clientName",
                          "clientUrl",
                          "deviceIdentifier",
                          "ipAddress",
                          "serialNumber",
                          "tagNumber",
                          "siteName",
                          "location",
                          "manufacturer",
                          "modelNumber",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites": {
      "get": {
        "operationId": "site.list",
        "summary": "List sites",
        "description": "Pages through the sites in the caller's tenant, optionally narrowed to one client. A site whose client is hidden, one every linked source reports removed, one the sync has orphaned, and one the PSA marks inactive are all excluded. Ordered by id so a cursor is stable while rows are written.",
        "tags": [
          "site"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List sites",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "addressLine1": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "addressLine2": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "state": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "zip": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phone": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "timeZone": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isDefault": {
                            "type": "boolean"
                          },
                          "isInactive": {
                            "type": "boolean"
                          },
                          "lastSyncedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "name",
                          "addressLine1",
                          "addressLine2",
                          "city",
                          "state",
                          "zip",
                          "country",
                          "phone",
                          "timeZone",
                          "isDefault",
                          "isInactive",
                          "lastSyncedAt",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "site.create",
        "summary": "Create a site",
        "description": "Creates a new site (physical location) under a client in the caller's tenant. isDefault is caller-specified; no site is auto-promoted to default on create. A client id outside the tenant, archived, or that does not exist answers not_found.",
        "tags": [
          "site"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "addressLine1": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addressLine2": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "zip": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isDefault": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "clientId",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a site",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "addressLine1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zip": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "timeZone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isDefault": {
                          "type": "boolean"
                        },
                        "isInactive": {
                          "type": "boolean"
                        },
                        "lastSyncedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "clientId",
                        "name",
                        "addressLine1",
                        "addressLine2",
                        "city",
                        "state",
                        "zip",
                        "country",
                        "phone",
                        "timeZone",
                        "isDefault",
                        "isInactive",
                        "lastSyncedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "site"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}": {
      "get": {
        "operationId": "site.get",
        "summary": "Get a site",
        "description": "Reads one active site in the caller's tenant. An archived site, one the PSA marks inactive, one every linked source reports removed, one the sync has orphaned, one under a hidden client, and one in another tenant all answer not_found.",
        "tags": [
          "site"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a site",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "addressLine1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zip": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "timeZone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isDefault": {
                          "type": "boolean"
                        },
                        "isInactive": {
                          "type": "boolean"
                        },
                        "lastSyncedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "clientId",
                        "name",
                        "addressLine1",
                        "addressLine2",
                        "city",
                        "state",
                        "zip",
                        "country",
                        "phone",
                        "timeZone",
                        "isDefault",
                        "isInactive",
                        "lastSyncedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "site"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "site.update",
        "summary": "Update a site",
        "description": "Updates one or more fields of an existing site in the caller's tenant. A field left out of the request is unchanged; a field sent as null clears it. clientId can reparent a manual site to a different client in the same tenant. For a site with active ConnectWise provenance, changing clientId or country answers conflict and writes nothing because neither has supported write-back. Other changed fields require enabled write-back, values ConnectWise accepts and a successfully queued provider command, or the whole update answers conflict and writes nothing. Unchanged values are allowed without a new provider command. crmWriteBackEnqueued reports whether this update queued a command. A site id outside the tenant or that does not exist answers not_found; a client id outside the tenant, archived, or that does not exist answers not_found.",
        "tags": [
          "site"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "addressLine1": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addressLine2": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "zip": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a site",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "addressLine1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zip": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "timeZone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isDefault": {
                          "type": "boolean"
                        },
                        "isInactive": {
                          "type": "boolean"
                        },
                        "lastSyncedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "clientId",
                        "name",
                        "addressLine1",
                        "addressLine2",
                        "city",
                        "state",
                        "zip",
                        "country",
                        "phone",
                        "timeZone",
                        "isDefault",
                        "isInactive",
                        "lastSyncedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "crmWriteBackEnqueued": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "site",
                    "crmWriteBackEnqueued"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "location.delete",
        "summary": "Delete a site",
        "description": "Permanently deletes a site (physical location) in the caller's workspace. Related agreements, clients, configurations, contacts, opportunities, quotes and tickets are kept, but their references to the deleted site are cleared. A client's default site and quote shipping locations are also cleared when they name this site. Deletes the site in Scopable only; a ConnectWise site of the same name is untouched. A site id outside the workspace, or that does not exist, answers not_found.",
        "tags": [
          "location"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete a site",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "siteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "siteId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/archive": {
      "post": {
        "operationId": "site.archive",
        "summary": "Archive a site",
        "description": "Soft-deletes one site in the caller's tenant: hides it from every site read, clears its default flag, and clears the client's default-site pointer if this site held it. The record and every reference to it are kept. Archiving is Scopable-only and is not written back to ConnectWise or Halo, and no sync reverses it. A site that is already archived answers with its current state rather than an error. A site id outside the tenant or that does not exist answers not_found.",
        "tags": [
          "site"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Archive a site",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "addressLine1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addressLine2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zip": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "timeZone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isDefault": {
                          "type": "boolean"
                        },
                        "isInactive": {
                          "type": "boolean"
                        },
                        "lastSyncedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "clientId",
                        "name",
                        "addressLine1",
                        "addressLine2",
                        "city",
                        "state",
                        "zip",
                        "country",
                        "phone",
                        "timeZone",
                        "isDefault",
                        "isInactive",
                        "lastSyncedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "archivedAt": {
                      "type": "string"
                    },
                    "defaultSiteCleared": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "site",
                    "archivedAt",
                    "defaultSiteCleared"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agreements": {
      "get": {
        "operationId": "agreement.search",
        "summary": "Search agreements",
        "description": "Pages through the caller's tenant's agreements, filtered by client, free text over the agreement name, and status. An agreement whose client is hidden, one a resync has orphaned, and one the PSA no longer backs are excluded. Ordered by id so a cursor is stable while rows are written.",
        "tags": [
          "agreement"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search agreements",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientName": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingCycle": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "startDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "endDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "renewalDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "autoRenewal": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "amountMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "overageRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "includedHours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hoursUsed": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hoursRemaining": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "cancelledFlag": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "expiredFlag": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "notes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingTermsText": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastSyncedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "billAmountMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "totalAdditionsAmountMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "noEndingDateFlag": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "billingMethod": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sla": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "location": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "department": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "coverageType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "customerPo": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "workOrder": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "invoiceDescription": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "invoiceTemplate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "internalNotes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "clientName",
                          "name",
                          "type",
                          "status",
                          "billingCycle",
                          "startDate",
                          "endDate",
                          "renewalDate",
                          "autoRenewal",
                          "currency",
                          "amountMinor",
                          "hourlyRateMinor",
                          "overageRateMinor",
                          "includedHours",
                          "hoursUsed",
                          "hoursRemaining",
                          "cancelledFlag",
                          "expiredFlag",
                          "notes",
                          "billingTermsText",
                          "source",
                          "lastSyncedAt",
                          "createdAt",
                          "updatedAt",
                          "billAmountMinor",
                          "totalAdditionsAmountMinor",
                          "noEndingDateFlag",
                          "billingMethod",
                          "sla",
                          "location",
                          "department",
                          "coverageType",
                          "customerPo",
                          "workOrder",
                          "invoiceDescription",
                          "invoiceTemplate",
                          "internalNotes"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agreements/sync-readiness": {
      "get": {
        "operationId": "agreement.sync_readiness",
        "summary": "Get the agreement sync status",
        "description": "Whether the caller's tenant has any agreements synced from the PSA, and the latest ConnectWise agreement sync: the one running now, otherwise the last one to finish. Agreements sync by hand today, so there is no schedule.",
        "tags": [
          "agreement"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the agreement sync status",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "syncMode": {
                      "type": "string",
                      "const": "manual"
                    },
                    "schedule": {
                      "type": "string",
                      "const": "not_scheduled"
                    },
                    "hasSyncedAgreements": {
                      "type": "boolean"
                    },
                    "emptyStateReason": {
                      "type": "string",
                      "enum": [
                        "manual_sync_required",
                        "sync_failed",
                        "sync_in_progress"
                      ]
                    },
                    "latestAgreementSync": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "status": {
                              "type": "string"
                            },
                            "startedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "completedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "recordsProcessed": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "recordsErrored": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "lastError": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "status",
                            "startedAt",
                            "completedAt",
                            "updatedAt",
                            "recordsProcessed",
                            "recordsErrored",
                            "lastError"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "syncMode",
                    "schedule",
                    "hasSyncedAgreements",
                    "emptyStateReason",
                    "latestAgreementSync"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agreements/analytics": {
      "get": {
        "operationId": "agreement.analytics",
        "summary": "Get agreement analytics",
        "description": "A roll-up of the caller's tenant's agreements: active count, monthly and annual recurring revenue, the split by agreement type, agreements expiring within 30 days or expired, agreements with no recurring amount, and how many visible clients have or lack an active agreement. Counts only agreements and clients the Agreements list shows. Fails rather than reporting zero clients when the client count cannot be read.",
        "tags": [
          "agreement"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get agreement analytics",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "totalActive": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "totalMrrMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "totalArrMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "byType": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "mrrMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "type",
                          "count",
                          "mrrMinor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "expiringSoon": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "expired": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "zeroAmount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "clientCoverage": {
                      "type": "object",
                      "properties": {
                        "withAgreements": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "withoutAgreements": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "avgPerClient": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "withAgreements",
                        "withoutAgreements",
                        "avgPerClient"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "currency",
                    "totalActive",
                    "totalMrrMinor",
                    "totalArrMinor",
                    "byType",
                    "expiringSoon",
                    "expired",
                    "zeroAmount",
                    "clientCoverage"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agreements/{agreementId}": {
      "get": {
        "operationId": "agreement.get",
        "summary": "Get an agreement",
        "description": "Reads one agreement by id from the caller's tenant, with its client's name, its start, end, renewal, and auto-renewal terms, and its billing and invoicing details. An id belonging to another tenant, to a hidden client, or to an agreement the PSA no longer backs answers not_found alike; existence is never leaked.",
        "tags": [
          "agreement"
        ],
        "parameters": [
          {
            "name": "agreementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get an agreement",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientName": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "billingCycle": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "endDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "renewalDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "autoRenewal": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "amountMinor": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "hourlyRateMinor": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "overageRateMinor": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "includedHours": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "hoursUsed": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "hoursRemaining": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "cancelledFlag": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "expiredFlag": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "notes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "billingTermsText": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSyncedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "billAmountMinor": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAdditionsAmountMinor": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "noEndingDateFlag": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "billingMethod": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sla": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "location": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "department": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "coverageType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "customerPo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "workOrder": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "invoiceDescription": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "invoiceTemplate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "internalNotes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "clientName",
                    "name",
                    "type",
                    "status",
                    "billingCycle",
                    "startDate",
                    "endDate",
                    "renewalDate",
                    "autoRenewal",
                    "currency",
                    "amountMinor",
                    "hourlyRateMinor",
                    "overageRateMinor",
                    "includedHours",
                    "hoursUsed",
                    "hoursRemaining",
                    "cancelledFlag",
                    "expiredFlag",
                    "notes",
                    "billingTermsText",
                    "source",
                    "lastSyncedAt",
                    "createdAt",
                    "updatedAt",
                    "billAmountMinor",
                    "totalAdditionsAmountMinor",
                    "noEndingDateFlag",
                    "billingMethod",
                    "sla",
                    "location",
                    "department",
                    "coverageType",
                    "customerPo",
                    "workOrder",
                    "invoiceDescription",
                    "invoiceTemplate",
                    "internalNotes"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tickets/search": {
      "get": {
        "operationId": "ticket.search",
        "summary": "Search tickets",
        "description": "Pages through the caller's tenant's tickets, filtered by client, free text over the summary, record type, and open or closed. A ticket whose client is hidden and one the PSA no longer backs are excluded; a ticket that names no client is returned, because it belongs to the tenant rather than to a company. Ordered by id so a cursor is stable while rows are written.",
        "tags": [
          "ticket"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "recordType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ServiceTicket",
                "ProjectTicket",
                "ProjectIssue"
              ]
            }
          },
          {
            "name": "open",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search tickets",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "siteId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "contactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agreementId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "recordType": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "ServiceTicket",
                                  "ProjectTicket",
                                  "ProjectIssue"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "summary": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "priority": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "board": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ownerName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dateEntered": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "requiredDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dateResolved": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "closedDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "closedFlag": {
                            "type": "boolean"
                          },
                          "isInSla": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "slaStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "respondMinutes": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "resolveMinutes": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "actualHours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "siteId",
                          "contactId",
                          "agreementId",
                          "recordType",
                          "summary",
                          "status",
                          "priority",
                          "board",
                          "ownerName",
                          "dateEntered",
                          "requiredDate",
                          "dateResolved",
                          "closedDate",
                          "closedFlag",
                          "isInSla",
                          "slaStatus",
                          "respondMinutes",
                          "resolveMinutes",
                          "actualHours",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tickets/time-breakdown": {
      "get": {
        "operationId": "ticket.time_breakdown",
        "summary": "Get a deterministic labor-hours breakdown for a set of tickets",
        "description": "Reads the labor hours logged against up to 100 tickets in the caller's tenant, given as one comma-separated string of ticket ids, grouped by work type, with entry and ticket counts per group and a grand total. A ticket whose client is hidden or that the PSA no longer backs contributes nothing, the same visibility rule ticket.get and ticket.search apply. noData is true when none of the given tickets have a single time entry -- distinct from a real zero, which a caller must not confuse with missing data.",
        "tags": [
          "ticket"
        ],
        "parameters": [
          {
            "name": "ticketIds",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Comma-separated ticket ids (UUIDs) in one string, at most 100. Not an array."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a deterministic labor-hours breakdown for a set of tickets",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "breakdown": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "workTypeId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "workTypeName": {
                            "type": "string"
                          },
                          "totalHours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "billedHours": {
                            "type": "number"
                          },
                          "entryCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "ticketCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "workTypeId",
                          "workTypeName",
                          "totalHours",
                          "billedHours",
                          "entryCount",
                          "ticketCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "grandTotalHours": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "noData": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "breakdown",
                    "count",
                    "grandTotalHours",
                    "noData"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tickets/concept-search": {
      "get": {
        "operationId": "ticket.concept_search",
        "summary": "Find past tickets for a kind of work",
        "description": "Finds the caller's tenant's tickets that look like a kind of work, for example a firewall replacement, closest match first, optionally for one client and an entered-date window. The results are candidates: judge which genuinely match, then call ticket.time_breakdown on the ones you keep for the hours actually logged. A ticket whose client is hidden or that the PSA no longer backs is never returned. Returns at most limit rows (default 25, at most 100), not a cursor-paged list. retrieval says whether the search ranked by meaning and keywords or by keywords alone, and why.",
        "tags": [
          "ticket"
        ],
        "parameters": [
          {
            "name": "concept",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Find past tickets for a kind of work",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "summary": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "typeName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "subtypeName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dateEntered": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "closedDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "actualHours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "relevanceScore": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "summary",
                          "typeName",
                          "subtypeName",
                          "dateEntered",
                          "closedDate",
                          "actualHours",
                          "relevanceScore"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "retrieval": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string",
                          "enum": [
                            "hybrid",
                            "keyword"
                          ]
                        },
                        "reason": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "embeddings_not_configured",
                                "embeddings_failed"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "mode",
                        "reason"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "retrieval"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tickets/{ticketId}": {
      "get": {
        "operationId": "ticket.get",
        "summary": "Get a ticket",
        "description": "Reads one ticket by id from the caller's tenant, with its note history, the time charged to it, and its sentiment reading. Notes the PSA marks internal or internal-analysis are never returned, and a time entry's free-text notes are not served at all. Both collections carry the 100 most recent rows, oldest first, and truncated says whether that cap was reached. An id belonging to another tenant, to a hidden client, or to a ticket the PSA no longer backs answers not_found alike; existence is never leaked.",
        "tags": [
          "ticket"
        ],
        "parameters": [
          {
            "name": "ticketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a ticket",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "siteId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "contactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agreementId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "recordType": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "ServiceTicket",
                            "ProjectTicket",
                            "ProjectIssue"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "summary": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "priority": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "board": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ownerName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dateEntered": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requiredDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dateResolved": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "closedDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "closedFlag": {
                      "type": "boolean"
                    },
                    "isInSla": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "slaStatus": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "respondMinutes": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "resolveMinutes": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "actualHours": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "text": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "authorName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "detailDescriptionFlag": {
                            "type": "boolean"
                          },
                          "resolutionFlag": {
                            "type": "boolean"
                          },
                          "externalFlag": {
                            "type": "boolean"
                          },
                          "customerUpdatedFlag": {
                            "type": "boolean"
                          },
                          "sentimentScore": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "dateCreated": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "text",
                          "authorName",
                          "detailDescriptionFlag",
                          "resolutionFlag",
                          "externalFlag",
                          "customerUpdatedFlag",
                          "sentimentScore",
                          "dateCreated"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "timeEntries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "memberName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "actualHours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hoursBilled": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "billableOption": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "timeStart": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "timeEnd": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dateEntered": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "memberName",
                          "actualHours",
                          "hoursBilled",
                          "billableOption",
                          "timeStart",
                          "timeEnd",
                          "dateEntered"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "truncated": {
                      "type": "object",
                      "properties": {
                        "notes": {
                          "type": "boolean"
                        },
                        "timeEntries": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "notes",
                        "timeEntries"
                      ],
                      "additionalProperties": false
                    },
                    "sentiment": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "sentimentScore": {
                              "type": "number"
                            },
                            "sentimentLabel": {
                              "type": "string"
                            },
                            "trajectory": {
                              "type": "string"
                            },
                            "themes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "riskFlags": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "analyzedAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "sentimentScore",
                            "sentimentLabel",
                            "trajectory",
                            "themes",
                            "riskFlags",
                            "analyzedAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "siteId",
                    "contactId",
                    "agreementId",
                    "recordType",
                    "summary",
                    "status",
                    "priority",
                    "board",
                    "ownerName",
                    "dateEntered",
                    "requiredDate",
                    "dateResolved",
                    "closedDate",
                    "closedFlag",
                    "isInSla",
                    "slaStatus",
                    "respondMinutes",
                    "resolveMinutes",
                    "actualHours",
                    "createdAt",
                    "updatedAt",
                    "notes",
                    "timeEntries",
                    "truncated",
                    "sentiment"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "project.list",
        "summary": "List projects",
        "description": "Pages through the caller's tenant's project tickets, filtered by client and free text over the name. Excludes projects whose client is hidden and projects no longer present in the PSA. Ordered by id and paged with an opaque cursor.",
        "tags": [
          "project"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List projects",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "priority": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "board": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ownerName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "openedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "targetDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "resolvedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "closedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "closedFlag": {
                            "type": "boolean"
                          },
                          "actualHours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "name",
                          "status",
                          "priority",
                          "board",
                          "ownerName",
                          "openedAt",
                          "targetDate",
                          "resolvedAt",
                          "closedAt",
                          "closedFlag",
                          "actualHours",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/service-health": {
      "get": {
        "operationId": "service_health.get",
        "summary": "Get a client's service health",
        "description": "Reads a client's service health: a live sentiment and risk-flag rollup computed from analyzed tickets over a trailing window, plus the most recent narrative the app has cached for the client that has not expired. The narrative may describe a different window from the rollup, which its own windowStart and windowEnd state; it is null when nothing unexpired is cached, and this operation never generates one. A client id belonging to another tenant, or to a client the app hides, answers not_found alike; existence is never leaked.",
        "tags": [
          "service_health"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "windowDays",
            "in": "query",
            "required": false,
            "schema": {
              "default": 90,
              "type": "integer",
              "minimum": 1,
              "maximum": 365
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client's service health",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "windowStart": {
                      "type": "string"
                    },
                    "windowEnd": {
                      "type": "string"
                    },
                    "narrative": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "headline": {
                              "type": "string"
                            },
                            "narrative": {
                              "type": "string"
                            },
                            "recommendedFocus": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "ticketCount": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "windowStart": {
                              "type": "string"
                            },
                            "windowEnd": {
                              "type": "string"
                            },
                            "generatedAt": {
                              "type": "string"
                            },
                            "expiresAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "headline",
                            "narrative",
                            "recommendedFocus",
                            "ticketCount",
                            "windowStart",
                            "windowEnd",
                            "generatedAt",
                            "expiresAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "rollup": {
                      "type": "object",
                      "properties": {
                        "ticketCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "averageSentimentScore": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "sentimentLabelCounts": {
                          "type": "object",
                          "properties": {
                            "positive": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "neutral": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "negative": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "mixed": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "positive",
                            "neutral",
                            "negative",
                            "mixed"
                          ],
                          "additionalProperties": false
                        },
                        "riskFlagCounts": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "latestSentimentScore": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "latestSentimentLabel": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "latestTrajectory": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "trend": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "ticketId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "dateEntered": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "windowDate": {
                                "type": "string"
                              },
                              "analyzedAt": {
                                "type": "string"
                              },
                              "sentimentScore": {
                                "type": "number"
                              },
                              "sentimentLabel": {
                                "type": "string"
                              },
                              "trajectory": {
                                "type": "string"
                              },
                              "riskFlags": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "ticketId",
                              "dateEntered",
                              "windowDate",
                              "analyzedAt",
                              "sentimentScore",
                              "sentimentLabel",
                              "trajectory",
                              "riskFlags"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "trendTruncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "ticketCount",
                        "averageSentimentScore",
                        "sentimentLabelCounts",
                        "riskFlagCounts",
                        "latestSentimentScore",
                        "latestSentimentLabel",
                        "latestTrajectory",
                        "trend",
                        "trendTruncated"
                      ],
                      "additionalProperties": false
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "narrativeGeneratedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "rollupComputedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "narrativeGeneratedAt",
                        "rollupComputedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "clientId",
                    "windowStart",
                    "windowEnd",
                    "narrative",
                    "rollup",
                    "freshness"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dashboard/stats": {
      "get": {
        "operationId": "dashboard.get_stats",
        "summary": "Get the tenant's dashboard stats snapshot",
        "description": "A snapshot of the caller's tenant's quote and opportunity pipeline: totals, win rates, MRR/NRR, and deal-size averages. Excludes a client whose only source reports it removed from the active-client count; every other total and rate is a plain aggregate over the tenant's quotes and opportunities.",
        "tags": [
          "dashboard"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the tenant's dashboard stats snapshot",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "totalQuotes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "totalValueMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "pendingQuotes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "winRatePercentage": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "activeClients": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "pendingMrrMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "pendingNrrMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "wonRevenueMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "wonMrrMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "wonNrrMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "wonQuotes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "lostQuotes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "draftQuotes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "avgDealSizeMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "pipelineValueSentMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "quoteToCloseRatio": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "activeOpportunities": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "oppPipelineValueMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "weightedPipelineValueMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "closedWonOpps": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "oppWinRate": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "avgOppDealSizeMinor": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "currency",
                    "totalQuotes",
                    "totalValueMinor",
                    "pendingQuotes",
                    "winRatePercentage",
                    "activeClients",
                    "pendingMrrMinor",
                    "pendingNrrMinor",
                    "wonRevenueMinor",
                    "wonMrrMinor",
                    "wonNrrMinor",
                    "wonQuotes",
                    "lostQuotes",
                    "draftQuotes",
                    "avgDealSizeMinor",
                    "pipelineValueSentMinor",
                    "quoteToCloseRatio",
                    "activeOpportunities",
                    "oppPipelineValueMinor",
                    "weightedPipelineValueMinor",
                    "closedWonOpps",
                    "oppWinRate",
                    "avgOppDealSizeMinor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dashboard/metrics": {
      "get": {
        "operationId": "dashboard.get_metrics",
        "summary": "Get the tenant's dashboard chart metrics",
        "description": "The caller's tenant's quote pipeline broken into chart-ready buckets: won quotes and won MRR/NRR over trailing 30/60/90-day windows, quote counts for the last 6 months, projected MRR/NRR for the next 6 months, and the overall close rate.",
        "tags": [
          "dashboard"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the tenant's dashboard chart metrics",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "openQuotes": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "wonQuotes": {
                      "type": "object",
                      "properties": {
                        "days30": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "days60": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "days90": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "days30",
                        "days60",
                        "days90"
                      ],
                      "additionalProperties": false
                    },
                    "wonMrr": {
                      "type": "object",
                      "properties": {
                        "days30Minor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "days60Minor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "days90Minor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "days30Minor",
                        "days60Minor",
                        "days90Minor"
                      ],
                      "additionalProperties": false
                    },
                    "wonNrr": {
                      "type": "object",
                      "properties": {
                        "days30Minor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "days60Minor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "days90Minor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "days30Minor",
                        "days60Minor",
                        "days90Minor"
                      ],
                      "additionalProperties": false
                    },
                    "quotesByMonth": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "month": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "month",
                          "count"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pipelineMrr": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "month": {
                            "type": "string"
                          },
                          "valueMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "month",
                          "valueMinor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pipelineNrr": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "month": {
                            "type": "string"
                          },
                          "valueMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "month",
                          "valueMinor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "closeRate": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "closeRateWon": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "closeRateLost": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "currency",
                    "openQuotes",
                    "wonQuotes",
                    "wonMrr",
                    "wonNrr",
                    "quotesByMonth",
                    "pipelineMrr",
                    "pipelineNrr",
                    "closeRate",
                    "closeRateWon",
                    "closeRateLost"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/search": {
      "get": {
        "operationId": "product.search",
        "summary": "Search the product catalog",
        "description": "Searches the workspace's managed product catalog by name, SKU, manufacturer, or ConnectWise product id, optionally narrowed by category and vendor. Inactive products and products a linked PSA reports as removed are excluded. Results are ordered by description with the product id as tiebreaker and paged with an opaque cursor. This is product identity and the MSP's own catalog pricing, not live distributor cost or availability: distributor.catalog_search searches the connected distributors' live catalogs.",
        "tags": [
          "product"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "vendor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search the product catalog",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "unitPrice": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "unitCost": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "productClass": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "manufacturer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "category": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "billingCycle": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "const": "product_catalog"
                          }
                        },
                        "required": [
                          "id",
                          "sku",
                          "name",
                          "description",
                          "unitPrice",
                          "unitCost",
                          "productClass",
                          "manufacturer",
                          "vendor",
                          "category",
                          "isRecurring",
                          "billingCycle",
                          "source"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/distributors/catalog/search": {
      "get": {
        "operationId": "distributor.catalog_search",
        "summary": "Search connected distributor catalogs",
        "description": "Searches the live catalogs of the distributors this workspace has connected (Ingram Micro, Pax8, and TD SYNNEX for a person inside its rollout) for a keyword and returns their first page of matches, up to ten per distributor, with the distributor's cost and suggested retail price where the distributor returns them. Ingram Micro prices come from its live price and availability check on the matched SKUs; a match Ingram Micro could not price comes back with a null cost rather than being dropped. This is not the workspace's own product catalog: use product.search for that, and prefer the catalog row when a SKU appears in both. Every connected distributor is listed in sources with whether it was searched; a distributor that could not be searched is reported with a reason instead of failing the call. A connected CDW is reported unavailable, and a connected TD SYNNEX is left out for anyone outside its rollout. No distributor connected answers with no rows and no sources.",
        "tags": [
          "distributor"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 200
            }
          },
          {
            "name": "vendor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search connected distributor catalogs",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "ingram",
                              "pax8",
                              "cdw",
                              "tdsynnex"
                            ]
                          },
                          "sourceProductId": {
                            "type": "string"
                          },
                          "sku": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "manufacturer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "unitCost": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "retailPrice": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "billingCycle": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "source",
                          "sourceProductId",
                          "sku",
                          "name",
                          "manufacturer",
                          "vendor",
                          "unitCost",
                          "retailPrice",
                          "isRecurring",
                          "billingCycle"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "source": {
                            "type": "string",
                            "enum": [
                              "ingram",
                              "pax8",
                              "cdw",
                              "tdsynnex"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "searched",
                              "unavailable"
                            ]
                          },
                          "resultCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "message": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "source",
                          "status",
                          "resultCount",
                          "reason",
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "data",
                    "sources"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}": {
      "get": {
        "operationId": "quote.get",
        "summary": "Get a quote",
        "description": "Reads one quote by id with its line items, a pricing summary over them, and its current statement of work. Any quote in the workspace can be read, not only one a conversation is about, so quotes can be compared across clients.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pricingSummary": {
                      "type": "object",
                      "properties": {
                        "totalOneTimeMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "One-time charges, billed once, in minor units."
                        },
                        "totalMrrMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Monthly recurring revenue in minor units: every recurring line's charge divided by the months in its billing cycle, so a quarterly line counts for a third and an annual line for a twelfth."
                        },
                        "totalNrrMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Non-recurring revenue in minor units. Always equal to totalOneTimeMinor."
                        },
                        "totalTcvMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Total contract value in minor units: the one-time charges plus each recurring line's monthly equivalent over that line's own term. A recurring line with no term of its own counts for twelve months."
                        },
                        "arrMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Annual recurring revenue in minor units: twelve times totalMrrMinor."
                        },
                        "monthlyBilledMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "What the monthly-billed lines charge each month, in minor units."
                        },
                        "biMonthlyBilledMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "What the lines billed every two months charge each time, in minor units."
                        },
                        "quarterlyBilledMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "What the quarterly-billed lines charge each quarter, in minor units."
                        },
                        "semiAnnualBilledMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "What the lines billed every six months charge each time, in minor units."
                        },
                        "annualBilledMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "What the annual-billed lines charge each year, in minor units."
                        },
                        "addOnMinor": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "The value over the term of the optional add-on lines that are counted, in minor units. Already included in the totals above."
                        },
                        "lineItemCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "The number of line items on the quote, counted or not."
                        }
                      },
                      "required": [
                        "totalOneTimeMinor",
                        "totalMrrMinor",
                        "totalNrrMinor",
                        "totalTcvMinor",
                        "arrMinor",
                        "monthlyBilledMinor",
                        "biMonthlyBilledMinor",
                        "quarterlyBilledMinor",
                        "semiAnnualBilledMinor",
                        "annualBilledMinor",
                        "addOnMinor",
                        "lineItemCount"
                      ],
                      "additionalProperties": false,
                      "description": "Revenue totals over the returned lines, in minor units. On an open quote every line counts except add-ons the client declined, so optional add-ons count until declined. On a won quote only accepted lines count. Each total is summed from unrounded line totals and rounded once, so it can differ by a cent from adding up the lines' rounded extendedPriceMinor values."
                    },
                    "sow": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "content": {
                              "type": "string"
                            },
                            "contentFormat": {
                              "type": "string"
                            },
                            "currentVersion": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "sections": {},
                            "createdBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "updatedAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "content",
                            "contentFormat",
                            "currentVersion",
                            "sections",
                            "createdBy",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems",
                    "pricingSummary",
                    "sow"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "quote.details_update",
        "summary": "Update a quote's setup details",
        "description": "Updates the quote-level fields: title, status, sales stage, probability, value, type, contact, location, dates, reps, client, site, and the linked opportunity. Moving a quote to Sent re-validates it (a client, a title, a positive total, an expiration date that is not past), recalculates the total from the line items, snapshots the client and contact, and records a version. A quote that is Signed, Accepted, or Won is locked: only its status may change. An expectedStatus mismatch refuses the save. Changing or clearing amounts requires quote pricing permission, and a Won status or sales stage requires permission to manually mark quotes won. Fields the linked ConnectWise opportunity mirrors are queued to it; `connectwiseSync` reports which.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "Draft",
                      "Sent",
                      "Published",
                      "Viewed",
                      "Signed",
                      "Accepted",
                      "Declined",
                      "Won",
                      "Lost",
                      "Cancelled",
                      "Expired"
                    ]
                  },
                  "expectedStatus": {
                    "type": "string",
                    "enum": [
                      "Draft",
                      "Sent",
                      "Published",
                      "Viewed",
                      "Signed",
                      "Accepted",
                      "Declined",
                      "Won",
                      "Lost",
                      "Cancelled",
                      "Expired"
                    ]
                  },
                  "salesStage": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "probability": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "valueMinor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "totalAmountMinor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9999999999,
                        "maximum": 9999999999
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quoteType": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "contactId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contactName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contactEmail": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contactPhone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "companyLocation": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "expectedCloseDate": {
                    "type": "string",
                    "format": "date",
                    "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])))$"
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 10000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "validUntil": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date",
                        "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])))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "opportunityId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "siteId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billingSiteId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "shippingSiteId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "customerPo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "wonLossReason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "layoutTemplateId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "salesRep1": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "salesRep2": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "connectwiseOpportunityId": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 2147483647
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a quote's setup details",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "connectwiseSync": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "skipped_by_policy",
                            "succeeded",
                            "failed",
                            "partial_success"
                          ]
                        },
                        "attempted": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attemptedFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "succeededFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "failedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "inputField": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "field",
                              "inputField",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "skippedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "inputField": {
                                "type": "string"
                              },
                              "field": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reason": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "inputField",
                              "field",
                              "reason",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "status",
                        "attempted",
                        "message",
                        "connectwiseOpportunityId",
                        "attemptedFields",
                        "succeededFields",
                        "failedFields",
                        "skippedFields"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems",
                    "connectwiseSync"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes": {
      "get": {
        "operationId": "quote.list",
        "summary": "List quotes",
        "description": "Pages through the quotes in the caller's tenant, newest first by creation time with the id as tiebreaker, paged with an opaque cursor (default page 50). clientId, salesStage, quoteType, status and salesRep1 narrow the list, and together they all have to hold. A text filter matches the whole value a quote carries in that field, ignoring case, and a quote with no value there never matches. Each row is the quote object quote.get returns, without its line items, pricing summary or statement of work; read one quote for those. Quotes on archived clients are included, as they are for quote.get. A clientId that is not in the caller's tenant matches nothing.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "salesStage",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "description": "The quote's sales stage, matched whole and ignoring case: Draft, Prospecting, Forecasted, Quoted, Recognized, Signed, Won, Lost or Cancelled."
            }
          },
          {
            "name": "quoteType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "description": "The quote's type, matched whole and ignoring case, for example Agreement."
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "description": "The quote's status, matched whole and ignoring case: Draft, Sent, Published, Viewed, Signed, Accepted, Declined, Won, Lost, Cancelled or Expired."
            }
          },
          {
            "name": "salesRep1",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "description": "The quote's primary sales rep, matched whole and ignoring case."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List quotes",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "url": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quoteNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "salesStage": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quoteType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "siteId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "clientLocation": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "contactName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "contactEmail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "contactPhone": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "opportunityId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "connectwiseOpportunityId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "probability": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "valueMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "totalAmountMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expirationDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "salesRep1": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "salesRep2": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "wonAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lostAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "signedOn": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "title",
                          "name",
                          "quoteNumber",
                          "status",
                          "salesStage",
                          "quoteType",
                          "description",
                          "clientId",
                          "clientName",
                          "siteId",
                          "clientLocation",
                          "contactName",
                          "contactEmail",
                          "contactPhone",
                          "opportunityId",
                          "connectwiseOpportunityId",
                          "probability",
                          "currency",
                          "valueMinor",
                          "totalAmountMinor",
                          "expirationDate",
                          "salesRep1",
                          "salesRep2",
                          "wonAt",
                          "lostAt",
                          "signedOn",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "quote.draft_create",
        "summary": "Create a quote draft",
        "description": "Creates a Draft quote for a client, with its line items, and sets the site, contact and linked opportunity when they are given. Nothing is sent to the client. With lines, the quote's value is their total; without, it is `valueMinor`. The answer suggests up to three of the client's opportunities whose titles match the quote's, for the caller to decide whether to link one.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "lineItems": {
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "sku": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "quantity": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 9999999999
                        },
                        "unitCostMinor": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9999999999
                        },
                        "unitPriceMinor": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9999999999
                        },
                        "category": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "billingType": {
                          "type": "string",
                          "enum": [
                            "one-time",
                            "monthly",
                            "annual"
                          ]
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 5000
                        }
                      },
                      "required": [
                        "name",
                        "unitPriceMinor"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "valueMinor": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9999999999
                  },
                  "salesStage": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "quoteType": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "probability": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "salesRep1": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "salesRep2": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "companyLocation": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "contactName": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "contactEmail": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "contactPhone": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "validUntil": {
                    "type": "string",
                    "format": "date",
                    "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])))$"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 10000
                  },
                  "opportunityId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "siteId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "connectwiseOpportunityId": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "clientId",
                  "lineItems"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a quote draft",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "opportunityMatchCandidates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "title": {
                            "type": "string"
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "stage": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url": {
                            "type": "string"
                          },
                          "matchScore": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "status",
                          "stage",
                          "createdAt",
                          "url",
                          "matchScore"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems",
                    "opportunityMatchCandidates"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/draft-items": {
      "post": {
        "operationId": "quote.draft_update",
        "summary": "Change a quote's line items in one call",
        "description": "Adds, removes, and updates line items on an existing quote in one save: additions first, then removals, then updates. A line id to remove or update that is not on the quote is refused, and nothing is saved.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "addItems": {
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "sku": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "quantity": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 9999999999
                        },
                        "unitCostMinor": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9999999999
                        },
                        "unitPriceMinor": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9999999999
                        },
                        "category": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "billingType": {
                          "type": "string",
                          "enum": [
                            "one-time",
                            "monthly",
                            "annual"
                          ]
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 5000
                        }
                      },
                      "required": [
                        "name",
                        "unitPriceMinor"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "removeItems": {
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "updateItems": {
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "lineItemId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "quantity": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 9999999999
                        },
                        "unitPriceMinor": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9999999999
                        },
                        "unitCostMinor": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9999999999
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 5000
                        },
                        "sku": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "category": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "billingType": {
                          "type": "string",
                          "enum": [
                            "one-time",
                            "monthly",
                            "annual"
                          ]
                        }
                      },
                      "required": [
                        "lineItemId"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Change a quote's line items in one call",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/client": {
      "post": {
        "operationId": "quote.client_set",
        "summary": "Set a quote's client",
        "description": "Points the quote at a different client and clears what belonged to the old one: the contact, the location, the site, and the billing, shipping and per-line Ship To sites.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "clientId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set a quote's client",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "connectwiseSync": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "skipped_by_policy",
                            "succeeded",
                            "failed",
                            "partial_success"
                          ]
                        },
                        "attempted": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attemptedFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "succeededFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "failedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "inputField": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "field",
                              "inputField",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "skippedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "inputField": {
                                "type": "string"
                              },
                              "field": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reason": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "inputField",
                              "field",
                              "reason",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "status",
                        "attempted",
                        "message",
                        "connectwiseOpportunityId",
                        "attemptedFields",
                        "succeededFields",
                        "failedFields",
                        "skippedFields"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems",
                    "connectwiseSync"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/site": {
      "post": {
        "operationId": "quote.site_set",
        "summary": "Set a quote's site",
        "description": "Selects one of the quote client's sites as the quote's location, and its name as the location text. A site of another client is refused.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "siteId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "siteId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set a quote's site",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "connectwiseSync": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "skipped_by_policy",
                            "succeeded",
                            "failed",
                            "partial_success"
                          ]
                        },
                        "attempted": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attemptedFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "succeededFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "failedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "inputField": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "field",
                              "inputField",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "skippedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "inputField": {
                                "type": "string"
                              },
                              "field": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reason": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "inputField",
                              "field",
                              "reason",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "status",
                        "attempted",
                        "message",
                        "connectwiseOpportunityId",
                        "attemptedFields",
                        "succeededFields",
                        "failedFields",
                        "skippedFields"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems",
                    "connectwiseSync"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/contact": {
      "post": {
        "operationId": "quote.contact_create_select",
        "summary": "Create a contact and select it on the quote",
        "description": "Creates a contact on the quote's client and makes it the quote's contact in one step. It becomes the client's default contact only when the client had none; picking a contact for a quote never creates a second primary.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "firstName": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "lastName": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "title": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a contact and select it on the quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "connectwiseSync": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "skipped_by_policy",
                            "succeeded",
                            "failed",
                            "partial_success"
                          ]
                        },
                        "attempted": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attemptedFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "succeededFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "failedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "inputField": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "field",
                              "inputField",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "skippedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "inputField": {
                                "type": "string"
                              },
                              "field": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reason": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "inputField",
                              "field",
                              "reason",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "status",
                        "attempted",
                        "message",
                        "connectwiseOpportunityId",
                        "attemptedFields",
                        "succeededFields",
                        "failedFields",
                        "skippedFields"
                      ],
                      "additionalProperties": false
                    },
                    "contactId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "contactName": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems",
                    "connectwiseSync",
                    "contactId",
                    "contactName"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/location": {
      "post": {
        "operationId": "quote.location_create_select",
        "summary": "Create a location and select it on the quote",
        "description": "Creates a site on the quote's client, unlinked from ConnectWise, and makes it the quote's location in one step.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "state": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "zipCode": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "country": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "isPrimary": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a location and select it on the quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "connectwiseSync": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "skipped_by_policy",
                            "succeeded",
                            "failed",
                            "partial_success"
                          ]
                        },
                        "attempted": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attemptedFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "succeededFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "failedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "inputField": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "field",
                              "inputField",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "skippedFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "inputField": {
                                "type": "string"
                              },
                              "field": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reason": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "inputField",
                              "field",
                              "reason",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "status",
                        "attempted",
                        "message",
                        "connectwiseOpportunityId",
                        "attemptedFields",
                        "succeededFields",
                        "failedFields",
                        "skippedFields"
                      ],
                      "additionalProperties": false
                    },
                    "siteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "siteName": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems",
                    "connectwiseSync",
                    "siteId",
                    "siteName"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/line-items": {
      "post": {
        "operationId": "quote.line_item_add",
        "summary": "Add a line item to a quote",
        "description": "Adds one product or service line to the end of a quote. Quantity defaults to 1; the billing type decides whether the line recurs and its commitment term. A distributor pricing source (`ingram`, `ingram_cloud`, `cdw`, `pax8`, `tdsynnex`) needs `unitCostMinor`, the cost the distributor quoted, so the line's margin is real. A quote that is Signed, Accepted, or Won is locked and refuses the change. It sets the line's price, so it needs `change_quote_pricing` as well as `edit_quotes`; every member and a `quote:write` key hold both unless an admin denied the member pricing.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "quantity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 9999999999
                  },
                  "unitPriceMinor": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9999999999
                  },
                  "unitCostMinor": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9999999999
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 5000
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "billingType": {
                    "type": "string",
                    "enum": [
                      "one-time",
                      "monthly",
                      "annual"
                    ]
                  },
                  "sku": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "pricingSource": {
                    "type": "string",
                    "enum": [
                      "manual",
                      "connectwise",
                      "ingram",
                      "ingram_cloud",
                      "cdw",
                      "pax8",
                      "tdsynnex",
                      "market_reference"
                    ]
                  },
                  "sourceMetadata": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "name",
                  "unitPriceMinor"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add a line item to a quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/line-items/{lineItemId}": {
      "patch": {
        "operationId": "quote.line_item_update",
        "summary": "Update a quote line item",
        "description": "Changes one line item's name, quantity, price, cost, description, category, billing type, or pricing provenance. Fields left out keep their value; an empty name keeps the old one. A line whose pricing source is, or becomes, a distributor's needs `unitCostMinor` unless it already carries a nonzero distributor cost, which it keeps. A line inside a bundle takes its quantity from the bundle, so a quantity for one is refused. It needs `change_quote_pricing` as well as `edit_quotes`, whichever fields change.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "lineItemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "quantity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 9999999999
                  },
                  "unitPriceMinor": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9999999999
                  },
                  "unitCostMinor": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9999999999
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 5000
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "billingType": {
                    "type": "string",
                    "enum": [
                      "one-time",
                      "monthly",
                      "annual"
                    ]
                  },
                  "pricingSource": {
                    "type": "string",
                    "enum": [
                      "manual",
                      "connectwise",
                      "ingram",
                      "ingram_cloud",
                      "cdw",
                      "pax8",
                      "tdsynnex",
                      "market_reference"
                    ]
                  },
                  "sourceMetadata": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a quote line item",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "quote.line_item_remove",
        "summary": "Remove a quote line item",
        "description": "Deletes one line item from a quote. The quote and every other line keep theirs.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "lineItemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove a quote line item",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/discount": {
      "post": {
        "operationId": "quote.discount_apply",
        "summary": "Apply a discount to a quote",
        "description": "Lowers one line item's unit price by a percentage, or every line's when no line is named, rounding each new price to the cent. It needs `change_quote_pricing`, which every member and a `quote:write` key hold. Setting a line's price directly (`quote.line_item_add`, `quote.line_item_update`) needs it too.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "discountPercent": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "lineItemId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "discountPercent"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Apply a discount to a quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/labor": {
      "post": {
        "operationId": "quote.labor_add",
        "summary": "Add labor to a quote",
        "description": "Adds a labor line: hours times rate folded into one price at quantity 1, with the hours and the rate kept for display. Without a rate it uses the workspace's default hourly rate from Operations settings, and a workspace with none is refused rather than quoted at zero.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "hours": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 99999999
                  },
                  "hourlyRateMinor": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9999999999
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "description",
                  "hours"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add labor to a quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/shipping": {
      "post": {
        "operationId": "quote.shipping_add",
        "summary": "Add shipping to a quote",
        "description": "Adds a shipping or freight line priced at its cost.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "costMinor": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9999999999
                  },
                  "carrier": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "description",
                  "costMinor"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add shipping to a quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "title",
                        "name",
                        "quoteNumber",
                        "status",
                        "salesStage",
                        "quoteType",
                        "description",
                        "clientId",
                        "clientName",
                        "siteId",
                        "clientLocation",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "probability",
                        "currency",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "wonAt",
                        "lostAt",
                        "signedOn",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "sku": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "unitCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "unitPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedCostMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "extendedPriceMinor": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "marginPercentage": {
                            "type": "number"
                          },
                          "category": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commitmentTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Months between charges for a recurring line: 1 monthly, 2 bi-monthly, 3 quarterly, 6 semi-annual, 12 annual. Null for a one-time line. billingFrequency carries only the nearest of monthly, quarterly and annual, so read this field for the exact cycle."
                          },
                          "termMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "How long a recurring line runs, in months. Null for a one-time line. commitmentTerm carries only the nearest of month-to-month, 1-year, 2-year and 3-year, so read this field for the exact term."
                          },
                          "lineStatus": {
                            "description": "Whether the client takes the line: pending, accepted or declined. Null for a required line on an open quote. An optional add-on is pending until the client decides; on a won quote only accepted lines count toward the totals, and on an open quote every line counts except declined ones.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isRecurring": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "isOptional": {
                            "type": "boolean"
                          },
                          "lineItemType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hours": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "hourlyRateMinor": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "carrier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingSource": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bundleId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bundleUnitQuantity": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "itemName",
                          "sku",
                          "quantity",
                          "unitCostMinor",
                          "unitPriceMinor",
                          "extendedCostMinor",
                          "extendedPriceMinor",
                          "marginPercentage",
                          "category",
                          "description",
                          "displayOrder",
                          "billingFrequency",
                          "commitmentTerm",
                          "billingPeriodMonths",
                          "termMonths",
                          "lineStatus",
                          "isRecurring",
                          "isOptional",
                          "lineItemType",
                          "hours",
                          "hourlyRateMinor",
                          "carrier",
                          "pricingSource",
                          "vendor",
                          "bundleId",
                          "bundleUnitQuantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quote",
                    "lineItems"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/sow/restore": {
      "post": {
        "operationId": "quote.sow_version_restore",
        "summary": "Restore a statement of work version",
        "description": "Overwrites the quote's live statement of work with a previously saved version. The overwrite is itself recorded as a new version, so the replaced content stays in history, but the SOW on the quote, its PDF and the client's view change immediately.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "versionNumber": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "versionNumber"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Restore a statement of work version",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "url": {
                      "type": "string"
                    },
                    "sow": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "content": {
                          "type": "string"
                        },
                        "contentFormat": {
                          "type": "string"
                        },
                        "currentVersion": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "sections": {},
                        "createdBy": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "content",
                        "contentFormat",
                        "currentVersion",
                        "sections",
                        "createdBy",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "restoredVersionNumber": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "quoteId",
                    "url",
                    "sow",
                    "restoredVersionNumber"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/layout": {
      "patch": {
        "operationId": "quote.layout_update",
        "summary": "Update a quote's layout override",
        "description": "Reorders, hides or reveals the sections of one quote by merging a sparse Quote Layout v2 patch into the quote's own override, or clears the override so the quote falls back to its template. Array entries are matched by id or key; an array entry with neither is refused as ambiguous. The template itself is edited in Settings and is not touched here.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "layoutOverride": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "clearLayoutOverride": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a quote's layout override",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "url": {
                      "type": "string"
                    },
                    "layoutOverride": {
                      "anyOf": [
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "quoteId",
                    "url",
                    "layoutOverride"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/sow": {
      "delete": {
        "operationId": "quote.sow_delete",
        "summary": "Delete a statement of work",
        "description": "Permanently deletes the quote's statement of work and its whole version history, and clears the quote's cached PDF. The quote itself is kept. This cannot be undone. A quote with no statement of work answers not_found.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete a statement of work",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "sowId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "versionsDeleted": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "quoteId",
                    "sowId",
                    "versionsDeleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "quote.sow_save",
        "summary": "Save a statement of work",
        "description": "Replaces the quote's live statement of work, or creates it on the first save. The replaced content stays in the SOW's version history, but the SOW on the quote, its PDF and the client's view change immediately. The statement of work is saved as HTML, which is what the editor, the PDF and the client's view show. Send Markdown in content and it is converted: # and ## headings become sections, and lists, bold, italic and links carry over. With sections (HTML bodies), content must be exactly the HTML they flatten to. To propose a change for a person to review instead, use quote.sow_draft.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "content": {
                    "type": "string",
                    "description": "The whole statement of work, at most 2 MB. It is saved as HTML: each section is an <h2> heading followed by its body, and a body can use <p>, <h3>, <ul>, <ol>, <li>, <strong>, <em> and <a>. Markdown is converted: a # or ## heading starts a new section, text before the first heading becomes an untitled introduction, ### and smaller headings stay inside their section, and lists (nested ones included), bold, italic and links carry over. With sections, content must be exactly the HTML the sections flatten to."
                  },
                  "contentFormat": {
                    "description": "How content is written: markdown, html or plain. Left out, content containing HTML tags is read as html and anything else as markdown. Markdown and plain text are converted to HTML before saving, so the saved statement of work is always HTML.",
                    "type": "string",
                    "enum": [
                      "markdown",
                      "html",
                      "plain"
                    ]
                  },
                  "sections": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "maxLength": 128
                        },
                        "key": {
                          "type": "string",
                          "maxLength": 128
                        },
                        "contentHash": {
                          "type": "string",
                          "maxLength": 128
                        },
                        "heading": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "body": {
                          "type": "string",
                          "description": "The section's body as HTML, for example <p>, <h3>, <ul>, <ol>, <li>, <strong>, <em> and <a>. It is saved as given, so Markdown here shows as literal text. To send Markdown, put the whole statement of work in content and leave sections out."
                        },
                        "pageBreakBefore": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "heading",
                        "body"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Save a statement of work",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "url": {
                      "type": "string"
                    },
                    "sow": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "content": {
                          "type": "string"
                        },
                        "contentFormat": {
                          "type": "string"
                        },
                        "currentVersion": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "sections": {},
                        "createdBy": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "content",
                        "contentFormat",
                        "currentVersion",
                        "sections",
                        "createdBy",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "quoteId",
                    "url",
                    "sow"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/detail": {
      "get": {
        "operationId": "quote.detail",
        "summary": "Get a quote record",
        "description": "Reads one quote in the caller's tenant as the quote wizard renders it: every field the quote carries, its client's name, the payment arrangement and latest payment attempt, the latest saved version, the send delivery and public view counts, the latest approval request, recurring and one-time totals from its lines, and the author's and last editor's names. A quote in another tenant answers not_found. Amounts are integers in minor units, rounded to the cent. For an API key the signature image, document path, legal-terms snapshot, layout, author, editor, customer purchase order, sync times, ConnectWise write-back status and the provider reference, event id and failure details of the latest payment are null.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a quote record",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "tenantId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesStage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteTypeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "probability": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "valueMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expirationDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "salesRep1": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "salesRep1Id": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "salesRep2Id": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "customerPo": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "poNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonLossReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientLocation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientNameSnapshot": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientLocationSnapshot": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactNameSnapshot": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactEmailSnapshot": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactPhoneSnapshot": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "billingSiteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shippingSiteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "opportunityId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseOpportunityId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdBy": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastEditedBy": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "lastEditedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "externalUpdatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastSyncedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "wonAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lostAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedByEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedByInitials": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signedOn": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "signatureSvg": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "acceptedTerms": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "legalTermsSnapshot": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "legalTermsSnapshotAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "pdfUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "pdfGeneratedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "layoutTemplateId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "layoutOverrideJson": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "hasPublicLink": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "shareRevokedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "originCoworkTurnId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "quoteProductWritebackRevision": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseProductWritebackStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connectwiseProductWritebackError": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connectwiseProductWritebackCommandId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseProductWritebackUpdatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "companyName": {
                          "type": "string"
                        },
                        "createdByName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastEditedByName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "mrrMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nrrMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "tcvMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "approvalStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "approvalDate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "paymentTerms": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "tenantId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "quoteId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "paymentMode": {
                                  "type": "string",
                                  "enum": [
                                    "full",
                                    "deposit",
                                    "net_terms"
                                  ]
                                },
                                "depositType": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "percentage",
                                        "fixed_amount"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "depositPercentageBps": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "depositAmountMinor": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "netDays": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "source": {
                                  "type": "string",
                                  "enum": [
                                    "tenant_default",
                                    "quote_override"
                                  ]
                                },
                                "createdAt": {
                                  "type": "string"
                                },
                                "updatedAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "quoteId",
                                "paymentMode",
                                "depositType",
                                "depositPercentageBps",
                                "depositAmountMinor",
                                "netDays",
                                "source",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "paymentSummary": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "quoteId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "tenantId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "paymentStatus": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "paid",
                                    "failed"
                                  ]
                                },
                                "providerKey": {
                                  "type": "string"
                                },
                                "providerPaymentRef": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "providerStatus": {
                                  "type": "string"
                                },
                                "amountMinor": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "currency": {
                                  "type": "string"
                                },
                                "paymentMethodType": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "lastProviderEventId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "failureCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "failureMessage": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "paidAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "failedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "canceledAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "refundedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "createdAt": {
                                  "type": "string"
                                },
                                "updatedAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "quoteId",
                                "tenantId",
                                "paymentStatus",
                                "providerKey",
                                "providerPaymentRef",
                                "providerStatus",
                                "amountMinor",
                                "currency",
                                "paymentMethodType",
                                "idempotencyKey",
                                "lastProviderEventId",
                                "failureCode",
                                "failureMessage",
                                "paidAt",
                                "failedAt",
                                "canceledAt",
                                "refundedAt",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "latestVersionNumber": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "quoteDeliveryAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quoteDeliveryStatus": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "delivered",
                                "sent"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "publicViewCount": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "firstPublicViewedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastPublicViewedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "tenantId",
                        "clientId",
                        "title",
                        "name",
                        "quoteNumber",
                        "description",
                        "status",
                        "salesStage",
                        "quoteType",
                        "quoteTypeId",
                        "probability",
                        "valueMinor",
                        "totalAmountMinor",
                        "expirationDate",
                        "salesRep1",
                        "salesRep2",
                        "salesRep1Id",
                        "salesRep2Id",
                        "customerPo",
                        "poNumber",
                        "wonLossReason",
                        "clientLocation",
                        "clientNameSnapshot",
                        "clientLocationSnapshot",
                        "contactId",
                        "contactName",
                        "contactEmail",
                        "contactPhone",
                        "contactNameSnapshot",
                        "contactEmailSnapshot",
                        "contactPhoneSnapshot",
                        "siteId",
                        "billingSiteId",
                        "shippingSiteId",
                        "opportunityId",
                        "connectwiseOpportunityId",
                        "createdBy",
                        "createdAt",
                        "updatedAt",
                        "lastEditedBy",
                        "lastEditedAt",
                        "externalUpdatedAt",
                        "lastSyncedAt",
                        "wonAt",
                        "lostAt",
                        "signedByEmail",
                        "signedByInitials",
                        "signedOn",
                        "signatureSvg",
                        "acceptedTerms",
                        "legalTermsSnapshot",
                        "legalTermsSnapshotAt",
                        "pdfUrl",
                        "pdfGeneratedAt",
                        "layoutTemplateId",
                        "layoutOverrideJson",
                        "hasPublicLink",
                        "shareRevokedAt",
                        "originCoworkTurnId",
                        "quoteProductWritebackRevision",
                        "connectwiseProductWritebackStatus",
                        "connectwiseProductWritebackError",
                        "connectwiseProductWritebackCommandId",
                        "connectwiseProductWritebackUpdatedAt",
                        "currency",
                        "clientName",
                        "companyName",
                        "createdByName",
                        "lastEditedByName",
                        "mrrMinor",
                        "nrrMinor",
                        "tcvMinor",
                        "approvalStatus",
                        "approvalDate",
                        "paymentTerms",
                        "paymentSummary",
                        "latestVersionNumber",
                        "quoteDeliveryAt",
                        "quoteDeliveryStatus",
                        "publicViewCount",
                        "firstPublicViewedAt",
                        "lastPublicViewedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "quote"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/payment-terms": {
      "get": {
        "operationId": "quote.payment_terms_get",
        "summary": "Get a quote's payment terms",
        "description": "Reads how the client pays for a quote: in full, a deposit (a percentage in basis points, or a fixed amount in minor units), or net terms in days. paymentTerms is null when the quote has none.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a quote's payment terms",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "paymentTerms": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "paymentMode": {
                              "type": "string",
                              "enum": [
                                "full",
                                "deposit",
                                "net_terms"
                              ]
                            },
                            "depositType": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "percentage",
                                    "fixed_amount"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "depositPercentageBps": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "depositAmountMinor": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "netDays": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "tenant_default",
                                "quote_override"
                              ]
                            }
                          },
                          "required": [
                            "paymentMode",
                            "depositType",
                            "depositPercentageBps",
                            "depositAmountMinor",
                            "netDays",
                            "updatedAt",
                            "source"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "quoteId",
                    "paymentTerms"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "quote.payment_terms_set",
        "summary": "Set a quote's payment terms",
        "description": "Replaces how the client pays for one quote: full, deposit or net terms, with every field that does not apply to the mode sent as null. The quote's cached PDF is cleared so the next download shows the new terms. A quote that is Signed, Accepted, or Won is locked and refuses the change.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "paymentTerms": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "paymentMode": {
                            "type": "string",
                            "const": "full"
                          },
                          "depositType": {
                            "type": "null"
                          },
                          "depositPercentageBps": {
                            "type": "null"
                          },
                          "depositAmountMinor": {
                            "type": "null"
                          },
                          "netDays": {
                            "type": "null"
                          }
                        },
                        "required": [
                          "paymentMode",
                          "depositType",
                          "depositPercentageBps",
                          "depositAmountMinor",
                          "netDays"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "paymentMode": {
                            "type": "string",
                            "const": "deposit"
                          },
                          "depositType": {
                            "type": "string",
                            "const": "percentage"
                          },
                          "depositPercentageBps": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 10000
                          },
                          "depositAmountMinor": {
                            "type": "null"
                          },
                          "netDays": {
                            "type": "null"
                          }
                        },
                        "required": [
                          "paymentMode",
                          "depositType",
                          "depositPercentageBps",
                          "depositAmountMinor",
                          "netDays"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "paymentMode": {
                            "type": "string",
                            "const": "deposit"
                          },
                          "depositType": {
                            "type": "string",
                            "const": "fixed_amount"
                          },
                          "depositPercentageBps": {
                            "type": "null"
                          },
                          "depositAmountMinor": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9999999999
                          },
                          "netDays": {
                            "type": "null"
                          }
                        },
                        "required": [
                          "paymentMode",
                          "depositType",
                          "depositPercentageBps",
                          "depositAmountMinor",
                          "netDays"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "paymentMode": {
                            "type": "string",
                            "const": "net_terms"
                          },
                          "depositType": {
                            "type": "null"
                          },
                          "depositPercentageBps": {
                            "type": "null"
                          },
                          "depositAmountMinor": {
                            "type": "null"
                          },
                          "netDays": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 365
                          }
                        },
                        "required": [
                          "paymentMode",
                          "depositType",
                          "depositPercentageBps",
                          "depositAmountMinor",
                          "netDays"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "paymentTerms"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set a quote's payment terms",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "paymentTerms": {
                      "type": "object",
                      "properties": {
                        "paymentMode": {
                          "type": "string",
                          "enum": [
                            "full",
                            "deposit",
                            "net_terms"
                          ]
                        },
                        "depositType": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "percentage",
                                "fixed_amount"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "depositPercentageBps": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "depositAmountMinor": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "netDays": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "tenant_default",
                            "quote_override"
                          ]
                        }
                      },
                      "required": [
                        "paymentMode",
                        "depositType",
                        "depositPercentageBps",
                        "depositAmountMinor",
                        "netDays",
                        "updatedAt",
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "quoteId",
                    "paymentTerms"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/versions": {
      "post": {
        "operationId": "quote.version_save",
        "summary": "Save a quote version",
        "description": "Records a numbered snapshot of the quote as it is now: its fields and line items. The quote itself does not change, and a quote in any status can be snapshotted.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "changeSummary": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Save a quote version",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "versionId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "versionNumber": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "quoteId",
                    "versionId",
                    "versionNumber"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/configurations": {
      "post": {
        "operationId": "quote.configuration_attach",
        "summary": "Attach configurations to a quote",
        "description": "Puts one or more of the client's IT assets (configurations) on a quote as assets it replaces or upgrades. An asset already on the quote takes the new action. The quote's cached PDF is cleared. A quote that is Signed, Accepted, or Won is locked and refuses the change.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "configurationIds": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "replace",
                      "upgrade"
                    ]
                  },
                  "notes": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "configurationIds",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attach configurations to a quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "quoteId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "configurationId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "action": {
                            "type": "string",
                            "enum": [
                              "replace",
                              "upgrade"
                            ]
                          },
                          "notes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "quoteId",
                          "configurationId",
                          "action",
                          "notes",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quoteId",
                    "links"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/configurations/{configurationId}": {
      "delete": {
        "operationId": "quote.configuration_detach",
        "summary": "Detach a configuration from a quote",
        "description": "Takes one IT asset (configuration) off a quote. The asset itself is not changed. The quote's cached PDF is cleared when the asset was on it. A quote that is Signed, Accepted, or Won is locked and refuses the change.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "configurationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Detach a configuration from a quote",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "configurationId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "detached": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "quoteId",
                    "configurationId",
                    "detached"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/peer-reviews": {
      "get": {
        "operationId": "quote.peer_review_list",
        "summary": "List a quote's peer reviews",
        "description": "Reads the informal peer reviews requested on a quote, newest first: who asked, the message, and each reviewer's status and comment.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a quote's peer reviews",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "reviews": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "quoteId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "requestedBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "requestedByName": {
                            "type": "string"
                          },
                          "requestedByEmail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "message": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "completed",
                              "cancelled"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "completedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reviewers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "reviewerId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "reviewerName": {
                                  "type": "string"
                                },
                                "reviewerEmail": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "reviewed"
                                  ]
                                },
                                "commentId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "commentBody": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "notifiedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "reviewedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "createdAt": {
                                  "type": "string"
                                },
                                "updatedAt": {
                                  "type": "string"
                                },
                                "isCurrentUser": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "id",
                                "reviewerId",
                                "reviewerName",
                                "reviewerEmail",
                                "status",
                                "commentId",
                                "commentBody",
                                "notifiedAt",
                                "reviewedAt",
                                "createdAt",
                                "updatedAt",
                                "isCurrentUser"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "quoteId",
                          "requestedBy",
                          "requestedByName",
                          "requestedByEmail",
                          "message",
                          "status",
                          "createdAt",
                          "updatedAt",
                          "completedAt",
                          "reviewers"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quoteId",
                    "reviews"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/share": {
      "post": {
        "operationId": "quote.share_publish",
        "summary": "Publish a quote's public link",
        "description": "Creates the link a client uses to view, comment on and sign a quote without logging in, replacing any earlier link. The quote must be Draft, Published, Sent, Viewed, Signed or Won and not expired; a Draft quote becomes Published. The link is shown only in this answer.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Publish a quote's public link",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "publicUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "quoteId",
                    "publicUrl",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/share/regenerate": {
      "post": {
        "operationId": "quote.share_regenerate",
        "summary": "Regenerate a quote's public link",
        "description": "Replaces a quote's public link with a new one; every earlier link stops working. The quote must be Draft, Published, Sent, Viewed, Signed or Won and not expired; a Draft quote becomes Published. The new link is shown only in this answer.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Regenerate a quote's public link",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "publicUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "quoteId",
                    "publicUrl",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/share/revoke": {
      "post": {
        "operationId": "quote.share_revoke",
        "summary": "Revoke a quote's public link",
        "description": "Stops every public link to a quote from working. Anyone holding an earlier link can no longer open the quote through it.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoke a quote's public link",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "revokedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "quoteId",
                    "revokedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quoteId}/pdf": {
      "post": {
        "operationId": "quote.pdf_enqueue",
        "summary": "Render a quote as a PDF",
        "description": "Starts rendering a quote as a PDF, or answers the document already stored or the render already under way. Pass force to render again. Rendering takes a few seconds: read the document's state until it is ready.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "force": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Render a quote as a PDF",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "queued",
                        "processing",
                        "failed",
                        "none"
                      ]
                    },
                    "downloadUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fileName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "generatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "quoteId",
                    "status",
                    "downloadUrl",
                    "fileName",
                    "generatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "quote.pdf_get",
        "summary": "Read a quote's PDF",
        "description": "Reads whether a quote's PDF is ready, still rendering, or failed, with a download link that works for one hour when it is ready. It starts no render.",
        "tags": [
          "quote"
        ],
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read a quote's PDF",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "queued",
                        "processing",
                        "failed",
                        "none"
                      ]
                    },
                    "downloadUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fileName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "generatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "quoteId",
                    "status",
                    "downloadUrl",
                    "fileName",
                    "generatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/summary": {
      "get": {
        "operationId": "compliance.summary",
        "summary": "Summarize a client's compliance",
        "description": "Summarizes a client's compliance: each active framework's score (compliant applicable controls with evidence, the compliance dashboard's figure), an overall score, and the client's open gaps by severity, with the same numbers as prose in the brief, detailed or client-facing format.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "frameworkId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "default": "brief",
              "type": "string",
              "enum": [
                "brief",
                "detailed",
                "client_facing"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Summarize a client's compliance",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientName": {
                      "type": "string"
                    },
                    "overallScore": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "compliantControls": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "totalControls": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "frameworks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "frameworkId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "version": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          },
                          "compliantControls": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "totalControls": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "frameworkId",
                          "name",
                          "version",
                          "score",
                          "compliantControls",
                          "totalControls"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "gaps": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "bySeverity": {
                          "type": "object",
                          "properties": {
                            "critical": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "high": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "medium": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "low": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "critical",
                            "high",
                            "medium",
                            "low"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "total",
                        "bySeverity"
                      ],
                      "additionalProperties": false
                    },
                    "summary": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "clientId",
                    "clientName",
                    "overallScore",
                    "compliantControls",
                    "totalControls",
                    "frameworks",
                    "gaps",
                    "summary"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/gaps": {
      "get": {
        "operationId": "compliance.gap_list",
        "summary": "List a client's compliance gaps",
        "description": "Lists a client's compliance gaps, open ones by default, most severe first, optionally narrowed by severity or framework. Each gap names its control and framework where it has one. Paged with an opaque cursor.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "default": "open",
              "type": "string",
              "enum": [
                "open",
                "in_progress",
                "resolved"
              ]
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "critical",
                "high",
                "medium",
                "low"
              ]
            }
          },
          {
            "name": "frameworkId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's compliance gaps",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "severity": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "critical",
                                  "high",
                                  "medium",
                                  "low"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "recommendation": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "controlId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "controlNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "controlTitle": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "frameworkId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "frameworkName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "description",
                          "severity",
                          "status",
                          "recommendation",
                          "controlId",
                          "controlNumber",
                          "controlTitle",
                          "frameworkId",
                          "frameworkName",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "compliance.gap_create",
        "summary": "Record a compliance gap for a client",
        "description": "Records an open compliance gap for a client: a title and severity, optionally the control and framework it falls under, a description and a recommendation. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "severity": {
                    "type": "string",
                    "enum": [
                      "critical",
                      "high",
                      "medium",
                      "low"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "recommendation": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "controlId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "frameworkId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "title",
                  "severity"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Record a compliance gap for a client",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "controlId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "frameworkId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "critical",
                            "high",
                            "medium",
                            "low"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "open",
                            "in_progress",
                            "resolved",
                            "accepted"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "actionType": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "ticket",
                            "quote",
                            "flagged",
                            "no_action"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "actionReferenceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "recommendation": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "identifiedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvalStatus": {
                      "type": "string",
                      "enum": [
                        "needs_review",
                        "reviewed",
                        "approved",
                        "rejected",
                        "changes_requested"
                      ]
                    },
                    "approvalReviewedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalReviewedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvalApprovedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalApprovedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "controlId",
                    "frameworkId",
                    "title",
                    "description",
                    "severity",
                    "status",
                    "actionType",
                    "actionReferenceId",
                    "recommendation",
                    "identifiedAt",
                    "resolvedAt",
                    "resolvedBy",
                    "approvalStatus",
                    "approvalReviewedAt",
                    "approvalReviewedBy",
                    "approvalApprovedAt",
                    "approvalApprovedBy",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/controls/by-number": {
      "get": {
        "operationId": "compliance.control_get",
        "summary": "Look up a compliance control by number",
        "description": "Returns one compliance control by its control number, with its guidance and framework. A number used by more than one framework resolves to the first framework by name; name the framework to choose. Only global frameworks and the workspace's own custom frameworks are searched.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "controlNumber",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "frameworkName",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Look up a compliance control by number",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "controlNumber": {
                      "type": "string"
                    },
                    "controlFamily": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "guidance": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "implementationGroup": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "frameworkId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "frameworkName": {
                      "type": "string"
                    },
                    "frameworkVersion": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "controlNumber",
                    "controlFamily",
                    "title",
                    "description",
                    "guidance",
                    "implementationGroup",
                    "frameworkId",
                    "frameworkName",
                    "frameworkVersion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/controls": {
      "get": {
        "operationId": "compliance.control_search",
        "summary": "Search compliance controls",
        "description": "Searches compliance control titles and descriptions for a keyword of at least two characters, optionally within one framework. Only global frameworks and the workspace's own custom frameworks are searched. Paged with an opaque cursor.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 200
            }
          },
          {
            "name": "frameworkId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search compliance controls",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "controlNumber": {
                            "type": "string"
                          },
                          "controlFamily": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "frameworkId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "frameworkName": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "controlNumber",
                          "controlFamily",
                          "title",
                          "description",
                          "frameworkId",
                          "frameworkName"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/mfa": {
      "get": {
        "operationId": "compliance.mfa_status",
        "summary": "Read a client's Microsoft 365 MFA status",
        "description": "Counts the client's synced Microsoft 365 users with and without MFA, through the client's active tenant mappings. With filter `mfa_enabled` or `mfa_disabled` it also lists up to `limit` of those users. The counts are always the client's totals.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "all",
                "mfa_enabled",
                "mfa_disabled"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read a client's Microsoft 365 MFA status",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "mapped": {
                      "type": "boolean"
                    },
                    "totalUsers": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "mfaEnabled": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "mfaDisabled": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "percentage": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "userPrincipalName": {
                            "type": "string"
                          },
                          "mfaEnabled": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "displayName",
                          "email",
                          "userPrincipalName",
                          "mfaEnabled"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "clientId",
                    "mapped",
                    "totalUsers",
                    "mfaEnabled",
                    "mfaDisabled",
                    "percentage",
                    "users"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/action-log": {
      "get": {
        "operationId": "compliance.action_log_list",
        "summary": "List a client's compliance action log",
        "description": "Lists the structured record of compliance work on a client (framework activations, gap and evidence changes, auditor shares), newest first, optionally narrowed by event, target, framework, gap, control, evidence artifact, action plan, actor or time. Each entry carries its before and after states and any linked artifact. Paged with an opaque cursor.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "eventType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "targetType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "framework",
                "control",
                "gap",
                "evidence",
                "auditor_share",
                "exception",
                "action_plan",
                "drift_alert"
              ]
            }
          },
          {
            "name": "targetId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "gapId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "controlId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "artifactId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "actionPlanId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "frameworkId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "actorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's compliance action log",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "eventType": {
                            "type": "string"
                          },
                          "targetType": {
                            "type": "string"
                          },
                          "targetId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "actorId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "actorName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "frameworkId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "controlId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "gapId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "artifactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "actionPlanId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "beforeState": {},
                          "afterState": {},
                          "linkedArtifact": {},
                          "createdAt": {
                            "type": "string"
                          },
                          "metadata": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "id",
                          "eventType",
                          "targetType",
                          "targetId",
                          "actorId",
                          "actorName",
                          "frameworkId",
                          "controlId",
                          "gapId",
                          "artifactId",
                          "actionPlanId",
                          "beforeState",
                          "afterState",
                          "linkedArtifact",
                          "createdAt",
                          "metadata"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/frameworks/{frameworkId}/activate": {
      "post": {
        "operationId": "compliance.framework_activate",
        "summary": "Activate a compliance framework for a client",
        "description": "Brings a client into scope for a compliance framework (global or the workspace's own), so its controls count toward the client's compliance score. A framework the client already has answers a conflict; one it had and turned off is turned back on with compliance.framework_reactivate.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "frameworkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Activate a compliance framework for a client",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "frameworkId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "frameworkName": {
                      "type": "string"
                    },
                    "frameworkVersion": {
                      "type": "string"
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "activatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "activatedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "frameworkId",
                    "frameworkName",
                    "frameworkVersion",
                    "isActive",
                    "activatedAt",
                    "activatedBy",
                    "notes",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/frameworks/{frameworkId}/deactivate": {
      "post": {
        "operationId": "compliance.framework_deactivate",
        "summary": "Deactivate a client's compliance framework",
        "description": "Takes a client out of scope for a compliance framework it has active. The scope, its evidence and its history are kept, and compliance.framework_reactivate turns it back on.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "frameworkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deactivate a client's compliance framework",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "frameworkId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "frameworkName": {
                      "type": "string"
                    },
                    "frameworkVersion": {
                      "type": "string"
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "activatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "activatedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "frameworkId",
                    "frameworkName",
                    "frameworkVersion",
                    "isActive",
                    "activatedAt",
                    "activatedBy",
                    "notes",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/frameworks/{frameworkId}/reactivate": {
      "post": {
        "operationId": "compliance.framework_reactivate",
        "summary": "Reactivate a client's compliance framework",
        "description": "Turns a compliance framework the client had deactivated back on, as activated now by the caller.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "frameworkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reactivate a client's compliance framework",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "frameworkId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "frameworkName": {
                      "type": "string"
                    },
                    "frameworkVersion": {
                      "type": "string"
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "activatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "activatedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "frameworkId",
                    "frameworkName",
                    "frameworkVersion",
                    "isActive",
                    "activatedAt",
                    "activatedBy",
                    "notes",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/gaps/{gapId}/connectwise-ticket": {
      "post": {
        "operationId": "compliance.gap_ticket_create",
        "summary": "Open a ConnectWise ticket for a compliance gap",
        "description": "Opens a service ticket in the workspace's ConnectWise Manage for a compliance gap, under the gap's client's ConnectWise company, optionally on a named board, priority and type. The ticket leaves Scopable: ConnectWise holds it from then on. Answers with the ticket's id, number and link.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "gapId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "cwCompanyId": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "summary": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000
                  },
                  "boardId": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priorityId": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "typeId": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "cwCompanyId",
                  "summary",
                  "description"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Open a ConnectWise ticket for a compliance gap",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ticketId": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "ticketNumber": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ticketId",
                    "ticketNumber",
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/users": {
      "get": {
        "operationId": "m365.user_list",
        "summary": "List synced Microsoft 365 users",
        "description": "Lists the Microsoft 365 users the M365 sync stored for this workspace, optionally for one client (through the client's active tenant mappings) and by MFA state. Ordered by user principal name and paged with an opaque cursor. A client with no active mapping has no users to list. This is the last sync's data, not a live Microsoft read.",
        "tags": [
          "m365"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "mfaFilter",
            "in": "query",
            "required": false,
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "all",
                "enabled",
                "disabled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List synced Microsoft 365 users",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "userPrincipalName": {
                            "type": "string"
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "mfaEnabled": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "mfaDetectionMethod": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "auth_methods",
                                  "registration_details",
                                  "unavailable"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastSyncAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "displayName",
                          "userPrincipalName",
                          "email",
                          "mfaEnabled",
                          "mfaDetectionMethod",
                          "lastSyncAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/mfa-summary": {
      "get": {
        "operationId": "m365.mfa_summary",
        "summary": "Summarize Microsoft 365 MFA coverage",
        "description": "Counts the synced Microsoft 365 users with and without MFA, for the whole workspace or for one client through its active tenant mappings. compliance.mfa_status gives the same counts for one client with an optional list of users.",
        "tags": [
          "m365"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Summarize Microsoft 365 MFA coverage",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clientId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "mapped": {
                      "type": "boolean"
                    },
                    "totalUsers": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "mfaEnabled": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "mfaDisabled": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "percentage": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "clientId",
                    "mapped",
                    "totalUsers",
                    "mfaEnabled",
                    "mfaDisabled",
                    "percentage"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/licenses": {
      "get": {
        "operationId": "m365.license_summary",
        "summary": "Count assigned Microsoft 365 licenses by SKU",
        "description": "Counts the Microsoft 365 licenses the M365 sync recorded against contacts, grouped by SKU, for the whole workspace or for one client through its active Microsoft tenant mappings. This is the last sync's data, not a live Microsoft read.",
        "tags": [
          "m365"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Count assigned Microsoft 365 licenses by SKU",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clientId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "licenses": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "skuId": {
                            "type": "string"
                          },
                          "skuPartNumber": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "skuId",
                          "skuPartNumber",
                          "count"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "totalLicenses": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "clientId",
                    "licenses",
                    "totalLicenses"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/sync-status": {
      "get": {
        "operationId": "m365.sync_status",
        "summary": "Read the Microsoft 365 integration's sync status",
        "description": "Whether the workspace has an active Microsoft 365 integration, and when it last synced, with what result and error.",
        "tags": [
          "m365"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Read the Microsoft 365 integration's sync status",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "integration": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "lastSyncAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "lastSyncStatus": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "syncErrorMessage": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "azureAdAppClientId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "createdAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "lastSyncAt",
                            "lastSyncStatus",
                            "syncErrorMessage",
                            "azureAdAppClientId",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "activeIntegrations": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "connected",
                    "integration",
                    "activeIntegrations"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/tenant-mappings": {
      "get": {
        "operationId": "m365.tenant_mapping_list",
        "summary": "List Microsoft 365 tenant mappings",
        "description": "Lists the active mappings between customers' Microsoft 365 tenants and Scopable clients, for the workspace's active Microsoft 365 integrations. Ordered by Microsoft tenant id and paged with an opaque cursor. No active integration answers with no mappings.",
        "tags": [
          "m365"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List Microsoft 365 tenant mappings",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "m365TenantId": {
                            "type": "string"
                          },
                          "m365TenantDomain": {
                            "type": "string"
                          },
                          "m365TenantName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          }
                        },
                        "required": [
                          "id",
                          "m365TenantId",
                          "m365TenantDomain",
                          "m365TenantName",
                          "clientId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/licenses": {
      "get": {
        "operationId": "license.summary",
        "summary": "Get a client's licence and subscription summary",
        "description": "Reads one client's licensing picture: the Microsoft 365 directory users with their MFA state, the licences assigned in the client's mapped Microsoft tenants counted by SKU, and the Pax8 subscriptions the platform provisioned for the client. Each source reports its own availability with a stable reason, so a source that is not connected, has stopped syncing or is not mapped to this client is never returned as an empty section. A key needs license:read and m365:read. A client in another workspace is not found.",
        "tags": [
          "license"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client's licence and subscription summary",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "generatedAt": {
                      "type": "string"
                    },
                    "microsoft365": {
                      "type": "object",
                      "properties": {
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "unavailable"
                          ]
                        },
                        "unavailableReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "asOf": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "userCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "mfaEnabledCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "mfaDisabledCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "mfaUnknownCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "assignedLicenseCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "skus": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "skuId": {
                                "type": "string"
                              },
                              "skuPartNumber": {
                                "type": "string"
                              },
                              "assignedCount": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "skuId",
                              "skuPartNumber",
                              "assignedCount"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "availability",
                        "unavailableReason",
                        "asOf",
                        "userCount",
                        "mfaEnabledCount",
                        "mfaDisabledCount",
                        "mfaUnknownCount",
                        "assignedLicenseCount",
                        "skus"
                      ],
                      "additionalProperties": false
                    },
                    "pax8": {
                      "type": "object",
                      "properties": {
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "unavailable"
                          ]
                        },
                        "unavailableReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "asOf": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "provisionedSubscriptionCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "subscriptions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "subscriptionId": {
                                "type": "string"
                              },
                              "productId": {
                                "type": "string"
                              },
                              "quantity": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "billingTerm": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "commitmentTermId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "orderStatus": {
                                "type": "string"
                              },
                              "orderedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "subscriptionId",
                              "productId",
                              "quantity",
                              "billingTerm",
                              "commitmentTermId",
                              "orderStatus",
                              "orderedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "availability",
                        "unavailableReason",
                        "asOf",
                        "provisionedSubscriptionCount",
                        "subscriptions"
                      ],
                      "additionalProperties": false
                    },
                    "unavailableSources": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "clientId",
                    "generatedAt",
                    "microsoft365",
                    "pax8",
                    "unavailableSources"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/security-posture": {
      "get": {
        "operationId": "security_posture.get",
        "summary": "Get a client's security posture",
        "description": "Reads one client's security posture from every source the platform stores: Microsoft 365 MFA state, RMM-projected endpoint protection (EDR, antivirus, patching, disk encryption), backup results and Liongard detections, plus the Secure Score and Defender sections the platform does not store. Every section reports its own availability with a stable reason token, and unavailableSources lists the ones that could not be read, so a source that is not connected, not mapped to this client or has stopped reporting is never returned as a clean result. Because it composes three domains, a key needs security_posture:read, configuration:read and m365:read. A client in another workspace is not found.",
        "tags": [
          "security_posture"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client's security posture",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "generatedAt": {
                      "type": "string"
                    },
                    "identity": {
                      "type": "object",
                      "properties": {
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "unavailable"
                          ]
                        },
                        "unavailableReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "asOf": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "userCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "mfaEnabledCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "mfaDisabledCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "mfaUnknownCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "availability",
                        "unavailableReason",
                        "asOf",
                        "userCount",
                        "mfaEnabledCount",
                        "mfaDisabledCount",
                        "mfaUnknownCount"
                      ],
                      "additionalProperties": false
                    },
                    "secureScore": {
                      "type": "object",
                      "properties": {
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "unavailable"
                          ]
                        },
                        "unavailableReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "asOf": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "availability",
                        "unavailableReason",
                        "asOf"
                      ],
                      "additionalProperties": false
                    },
                    "defender": {
                      "type": "object",
                      "properties": {
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "unavailable"
                          ]
                        },
                        "unavailableReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "asOf": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "availability",
                        "unavailableReason",
                        "asOf"
                      ],
                      "additionalProperties": false
                    },
                    "endpointProtection": {
                      "type": "object",
                      "properties": {
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "unavailable"
                          ]
                        },
                        "unavailableReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "asOf": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "deviceCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "rmmClaimedDeviceCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "edrReportedCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "antivirusReportedCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "patchReportedCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "diskEncryptionReportedCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "pendingPatchTotal": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "activeAlertTotal": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "edrStatusCounts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string"
                              },
                              "deviceCount": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "status",
                              "deviceCount"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "antivirusStatusCounts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string"
                              },
                              "deviceCount": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "status",
                              "deviceCount"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "diskEncryptionStatusCounts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string"
                              },
                              "deviceCount": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "status",
                              "deviceCount"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "availability",
                        "unavailableReason",
                        "asOf",
                        "deviceCount",
                        "rmmClaimedDeviceCount",
                        "edrReportedCount",
                        "antivirusReportedCount",
                        "patchReportedCount",
                        "diskEncryptionReportedCount",
                        "pendingPatchTotal",
                        "activeAlertTotal",
                        "edrStatusCounts",
                        "antivirusStatusCounts",
                        "diskEncryptionStatusCounts"
                      ],
                      "additionalProperties": false
                    },
                    "backup": {
                      "type": "object",
                      "properties": {
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "unavailable"
                          ]
                        },
                        "unavailableReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "asOf": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "reportingDeviceCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "successTotal": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "incompleteTotal": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "failedTotal": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "restoreSuccessTotal": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "restoreFailedTotal": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "availability",
                        "unavailableReason",
                        "asOf",
                        "reportingDeviceCount",
                        "successTotal",
                        "incompleteTotal",
                        "failedTotal",
                        "restoreSuccessTotal",
                        "restoreFailedTotal"
                      ],
                      "additionalProperties": false
                    },
                    "detections": {
                      "type": "object",
                      "properties": {
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "unavailable"
                          ]
                        },
                        "unavailableReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "asOf": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "openCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "resolvedCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "severityCounts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "severity": {
                                "type": "string"
                              },
                              "detectionCount": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "severity",
                              "detectionCount"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "availability",
                        "unavailableReason",
                        "asOf",
                        "openCount",
                        "resolvedCount",
                        "severityCounts"
                      ],
                      "additionalProperties": false
                    },
                    "unavailableSources": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "clientId",
                    "generatedAt",
                    "identity",
                    "secureScore",
                    "defender",
                    "endpointProtection",
                    "backup",
                    "detections",
                    "unavailableSources"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/security-posture/detections": {
      "get": {
        "operationId": "security_posture.detection_list",
        "summary": "List a client's Liongard detections",
        "description": "Lists one client's Liongard detections, newest first, optionally by severity and provider status. Resolved detections are left out unless includeResolved is set. When Liongard is not connected, its connection is failing or no environment is mapped to the client, the call answers unavailable with a reason instead of an empty list, because an empty list would read as a clean environment. A client in another workspace is not found.",
        "tags": [
          "security_posture"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "includeResolved",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's Liongard detections",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "externalDetectionId": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "severity": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "environmentName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "detectedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastSeenAt": {
                            "type": "string"
                          },
                          "resolvedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "externalDetectionId",
                          "title",
                          "severity",
                          "status",
                          "environmentName",
                          "detectedAt",
                          "lastSeenAt",
                          "resolvedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/emails": {
      "get": {
        "operationId": "email.search",
        "summary": "Search a client's email correspondence",
        "description": "Lists the email correspondence the platform holds for one client, messages synced from Microsoft 365 mailboxes and messages the platform sent, newest first. Filters by contact, subject text, source and a sent-time window. Bodies are neither returned nor searched here: read one with email.get, which needs a separate capability. A client in another workspace is not found.",
        "tags": [
          "email"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "contactId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "sentAfter",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          },
          {
            "name": "sentBefore",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search a client's email correspondence",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "occurredAt": {
                            "type": "string"
                          },
                          "source": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "fromAddress": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "toAddresses": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "ccAddresses": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "relatedEntityType": {
                            "type": "string"
                          },
                          "relatedEntityId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "contactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "hasBody": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "subject",
                          "occurredAt",
                          "source",
                          "fromAddress",
                          "toAddresses",
                          "ccAddresses",
                          "relatedEntityType",
                          "relatedEntityId",
                          "contactId",
                          "hasBody",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/emails/{emailId}": {
      "get": {
        "operationId": "email.get",
        "summary": "Read one email with its body",
        "description": "Reads one stored email message including its body. It needs view_compliance, the capability the existing correspondence-body read carries, so holding the CRM read that lists correspondence does not by itself grant the contents. An id in another workspace, or one that is not an email, is not found.",
        "tags": [
          "email"
        ],
        "parameters": [
          {
            "name": "emailId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read one email with its body",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "occurredAt": {
                      "type": "string"
                    },
                    "source": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fromAddress": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "toAddresses": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ccAddresses": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "relatedEntityType": {
                      "type": "string"
                    },
                    "relatedEntityId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "contactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "hasBody": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "body": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "subject",
                    "occurredAt",
                    "source",
                    "fromAddress",
                    "toAddresses",
                    "ccAddresses",
                    "relatedEntityType",
                    "relatedEntityId",
                    "contactId",
                    "hasBody",
                    "createdAt",
                    "updatedAt",
                    "body"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/meetings": {
      "get": {
        "operationId": "meeting.list",
        "summary": "List a client's meetings",
        "description": "Lists the Microsoft 365 meetings filed against one client, most recent first, optionally inside a start-time window. Cancelled and removed meetings are left out. Each row says whether a transcript exists and what state its processing is in; the transcript itself is meeting.transcript_get. A client in another workspace is not found.",
        "tags": [
          "meeting"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "startedAfter",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          },
          {
            "name": "startedBefore",
            "in": "query",
            "required": false,
            "schema": {
              "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)))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's meetings",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "startAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "endAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "location": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "onlineMeetingUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "externalLink": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "participantCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "hasTranscript": {
                            "type": "boolean"
                          },
                          "transcriptStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "syncedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "subject",
                          "startAt",
                          "endAt",
                          "location",
                          "onlineMeetingUrl",
                          "externalLink",
                          "participantCount",
                          "hasTranscript",
                          "transcriptStatus",
                          "syncedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/meetings/{meetingId}/transcript": {
      "get": {
        "operationId": "meeting.transcript_get",
        "summary": "Read a meeting transcript",
        "description": "Reads the processed transcript of one meeting: the generated summary, the model that wrote it, the attendees and the action items drawn from it. It needs access_ai_assistant rather than the calendar read that lists meetings, so seeing that a meeting happened does not grant what was said in it, and a workspace without AI features is refused the model's output. A meeting with no transcript, or one in another workspace, is not found. A transcript still being fetched or processed returns its status with an empty summary.",
        "tags": [
          "meeting"
        ],
        "parameters": [
          {
            "name": "meetingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read a meeting transcript",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meetingId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "startAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "endAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "summaryMarkdown": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "summaryModel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "summaryGeneratedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "transcriptFetchedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "transcriptProcessedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "transcriptError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "participants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isOrganizer": {
                            "type": "boolean"
                          },
                          "responseStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "email",
                          "displayName",
                          "isOrganizer",
                          "responseStatus"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "actionItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "body": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "assigneeName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "assigneeContactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dueDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sourceExcerpt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "body",
                          "status",
                          "assigneeName",
                          "assigneeContactId",
                          "dueDate",
                          "sourceExcerpt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "meetingId",
                    "clientId",
                    "subject",
                    "startAt",
                    "endAt",
                    "status",
                    "summaryMarkdown",
                    "summaryModel",
                    "summaryGeneratedAt",
                    "transcriptFetchedAt",
                    "transcriptProcessedAt",
                    "transcriptError",
                    "participants",
                    "actionItems"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/conditional-access-policies": {
      "get": {
        "operationId": "m365.conditional_access_policy_list",
        "summary": "Read a client's Conditional Access policies live",
        "description": "Reads the Entra ID Conditional Access policies of a client's Microsoft 365 tenant from Microsoft Graph now, with their state, conditions and grant controls. A client mapped to several Microsoft tenants needs m365TenantId. Answers unavailable when Microsoft refuses or cannot be reached.",
        "tags": [
          "m365"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "m365TenantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read a client's Conditional Access policies live",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "m365Tenant": {
                      "type": "object",
                      "properties": {
                        "m365TenantId": {
                          "type": "string"
                        },
                        "m365TenantDomain": {
                          "type": "string"
                        },
                        "m365TenantName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "m365TenantId",
                        "m365TenantDomain",
                        "m365TenantName"
                      ],
                      "additionalProperties": false
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "conditions": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "grantControls": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "state",
                          "conditions",
                          "grantControls"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "m365Tenant",
                    "data",
                    "count"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/intune-compliance-policies": {
      "get": {
        "operationId": "m365.intune_compliance_policy_list",
        "summary": "Read a client's Intune compliance policies live",
        "description": "Reads the Intune device compliance policies of a client's Microsoft 365 tenant from Microsoft Graph now. A client mapped to several Microsoft tenants needs m365TenantId. Answers unavailable when Microsoft refuses or cannot be reached.",
        "tags": [
          "m365"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "m365TenantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read a client's Intune compliance policies live",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "m365Tenant": {
                      "type": "object",
                      "properties": {
                        "m365TenantId": {
                          "type": "string"
                        },
                        "m365TenantDomain": {
                          "type": "string"
                        },
                        "m365TenantName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "m365TenantId",
                        "m365TenantDomain",
                        "m365TenantName"
                      ],
                      "additionalProperties": false
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "lastModified": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "lastModified"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "m365Tenant",
                    "data",
                    "count"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/defender-alerts": {
      "get": {
        "operationId": "m365.defender_alert_list",
        "summary": "Read a client's Microsoft Defender alerts live",
        "description": "Reads the newest Microsoft Defender alerts of a client's Microsoft 365 tenant from Microsoft Graph now, optionally of one severity, at most limit of them. A client mapped to several Microsoft tenants needs m365TenantId. Answers unavailable when Microsoft refuses or cannot be reached.",
        "tags": [
          "m365"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "m365TenantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "high",
                "medium",
                "low",
                "informational"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read a client's Microsoft Defender alerts live",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "m365Tenant": {
                      "type": "object",
                      "properties": {
                        "m365TenantId": {
                          "type": "string"
                        },
                        "m365TenantDomain": {
                          "type": "string"
                        },
                        "m365TenantName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "m365TenantId",
                        "m365TenantDomain",
                        "m365TenantName"
                      ],
                      "additionalProperties": false
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "severity",
                          "status",
                          "created",
                          "source"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "m365Tenant",
                    "data",
                    "count"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/secure-score": {
      "get": {
        "operationId": "m365.secure_score_get",
        "summary": "Read a client's Microsoft Secure Score live",
        "description": "Reads the latest Microsoft Secure Score of a client's Microsoft 365 tenant from Microsoft Graph now, with the first ten control scores. A client mapped to several Microsoft tenants needs m365TenantId. Answers unavailable when Microsoft refuses or cannot be reached.",
        "tags": [
          "m365"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "m365TenantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read a client's Microsoft Secure Score live",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "m365Tenant": {
                      "type": "object",
                      "properties": {
                        "m365TenantId": {
                          "type": "string"
                        },
                        "m365TenantDomain": {
                          "type": "string"
                        },
                        "m365TenantName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "m365TenantId",
                        "m365TenantDomain",
                        "m365TenantName"
                      ],
                      "additionalProperties": false
                    },
                    "score": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "currentScore": {
                              "type": "number"
                            },
                            "maxScore": {
                              "type": "number"
                            },
                            "percentage": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "asOf": {
                              "type": "string"
                            },
                            "topControls": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "controlName": {
                                    "type": "string"
                                  },
                                  "score": {
                                    "type": "number"
                                  },
                                  "maxScore": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "controlName",
                                  "score",
                                  "maxScore"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "currentScore",
                            "maxScore",
                            "percentage",
                            "asOf",
                            "topControls"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "m365Tenant",
                    "score"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m365/sharepoint-sites": {
      "get": {
        "operationId": "m365.sharepoint_site_list",
        "summary": "Read a client's SharePoint sites live",
        "description": "Reads the SharePoint sites of a client's Microsoft 365 tenant from Microsoft Graph now, at most limit of them. A client mapped to several Microsoft tenants needs m365TenantId. Answers unavailable when Microsoft refuses or cannot be reached.",
        "tags": [
          "m365"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "m365TenantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read a client's SharePoint sites live",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "m365Tenant": {
                      "type": "object",
                      "properties": {
                        "m365TenantId": {
                          "type": "string"
                        },
                        "m365TenantDomain": {
                          "type": "string"
                        },
                        "m365TenantName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "m365TenantId",
                        "m365TenantDomain",
                        "m365TenantName"
                      ],
                      "additionalProperties": false
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "created": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "url",
                          "created"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "m365Tenant",
                    "data",
                    "count"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/azure/customers": {
      "get": {
        "operationId": "azure.customer_list",
        "summary": "List Azure customers",
        "description": "Lists the workspace's active Azure customers from Partner Center, with the Scopable client each is mapped to and how that mapping was made. Ordered by customer name and paged with an opaque cursor.",
        "tags": [
          "azure"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List Azure customers",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "partnerCenterCustomerId": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "azureTenantId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "mappingStatus": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "auto_matched",
                                  "manual_mapped",
                                  "unmatched"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "partnerCenterCustomerId",
                          "name",
                          "azureTenantId",
                          "clientId",
                          "mappingStatus",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/azure/cost-summary": {
      "get": {
        "operationId": "azure.cost_summary",
        "summary": "Summarize Azure costs",
        "description": "Each active Azure customer's newest cost snapshot: the monthly cost estimate, the previous month's cost, the month-over-month change and the resource count. Optionally for one Azure customer or for the customers mapped to one client. Ordered by customer name and paged with an opaque cursor. This is the last sync's data, not a live Azure read.",
        "tags": [
          "azure"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "azureCustomerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Summarize Azure costs",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "latestSnapshot": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "snapshotDate": {
                                    "type": "string",
                                    "format": "date",
                                    "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])))$"
                                  },
                                  "monthlyCostEstimate": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "previousMonthCost": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "monthOverMonthChange": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "totalResourcesCount": {
                                    "anyOf": [
                                      {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "snapshotDate",
                                  "monthlyCostEstimate",
                                  "previousMonthCost",
                                  "monthOverMonthChange",
                                  "totalResourcesCount"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "clientId",
                          "latestSnapshot"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/azure/recommendations": {
      "get": {
        "operationId": "azure.recommendation_list",
        "summary": "List Azure optimization reports",
        "description": "Lists the Azure cost optimization reports the analysis job wrote, newest first, with their tier 1 (quick wins), tier 2 (medium-term) and tier 3 (strategic) recommendations and estimated monthly savings. Optionally for one Azure customer and one tier. `limit=1` with `azureCustomerId` is that customer's latest report. Paged with an opaque cursor.",
        "tags": [
          "azure"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "azureCustomerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "tier",
            "in": "query",
            "required": false,
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List Azure optimization reports",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "azureCustomerId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "analysisDate": {
                            "type": "string",
                            "format": "date",
                            "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])))$"
                          },
                          "estimatedMonthlySavings": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "tier1": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "tier2": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "tier3": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "azureCustomerId",
                          "analysisDate",
                          "estimatedMonthlySavings"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/azure/retail-prices": {
      "get": {
        "operationId": "azure.retail_price_search",
        "summary": "Search Azure retail prices",
        "description": "Looks up live Microsoft Azure list (pay-as-you-go) prices from Microsoft's public Retail Prices API, by service, region, SKU, product and price type. At least one of serviceName, armRegionName, skuName or productName is required. Prices are list rates: Reservation and Azure Hybrid Benefit savings apply separately. Answers unavailable when Microsoft's API cannot be reached.",
        "tags": [
          "azure"
        ],
        "parameters": [
          {
            "name": "serviceName",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "armRegionName",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "skuName",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "productName",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "priceType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Consumption",
                "Reservation",
                "DevTestConsumption"
              ]
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "default": "USD",
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search Azure retail prices",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "serviceName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "skuName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "meterName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "armRegionName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "location": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "retailPrice": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "unitOfMeasure": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "currencyCode": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "type": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reservationTerm": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "armSkuName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "serviceName",
                          "productName",
                          "skuName",
                          "meterName",
                          "armRegionName",
                          "location",
                          "retailPrice",
                          "unitOfMeasure",
                          "currencyCode",
                          "type",
                          "reservationTerm",
                          "armSkuName"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "filter": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "filter",
                    "currency"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/org/settings": {
      "get": {
        "operationId": "org.settings_get",
        "summary": "Get the workspace's quoting settings",
        "description": "Returns the workspace's live quoting configuration: default margin and margin floor (with whether each is the workspace's own or the platform default), approval threshold, billing terms (with whether they are the workspace's own or the platform default), default hourly rate, quoting style, distributor preferences and connection status, and the active pricing rules, which the server applies when a quote is saved. Use this, not memory, for org settings, quote defaults, margins, hourly rate, distributors or pricing rules.",
        "tags": [
          "org"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the workspace's quoting settings",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "orgName": {
                      "type": "string"
                    },
                    "tier": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "defaultMargin": {
                      "type": "number"
                    },
                    "defaultMarginIsConfigured": {
                      "type": "boolean"
                    },
                    "defaultMarginPlatformDefault": {
                      "type": "number"
                    },
                    "marginFloor": {
                      "type": "number"
                    },
                    "marginFloorIsConfigured": {
                      "type": "boolean"
                    },
                    "marginFloorPlatformDefault": {
                      "type": "number"
                    },
                    "approvalThreshold": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "billingTerms": {
                      "type": "string"
                    },
                    "billingTermsIsConfigured": {
                      "type": "boolean"
                    },
                    "billingTermsPlatformDefault": {
                      "type": "string"
                    },
                    "hourlyRate": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "hourlyRateIsConfigured": {
                      "type": "boolean"
                    },
                    "hourlyRateSource": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "tenant_pricing.hourly_rate_usd",
                            "tenant_settings.hourly_project_rate"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotingStyle": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "activeDistributors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "configuredDistributorPreferences": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "ingram",
                          "pax8",
                          "cdw",
                          "tdsynnex"
                        ]
                      }
                    },
                    "connectedDistributors": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "ingram",
                          "pax8",
                          "cdw",
                          "tdsynnex"
                        ]
                      }
                    },
                    "distributorConnectionStatuses": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "source": {
                            "type": "string",
                            "enum": [
                              "ingram",
                              "pax8",
                              "cdw",
                              "tdsynnex"
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "connected": {
                            "type": "boolean"
                          },
                          "isActive": {
                            "type": "boolean"
                          },
                          "connectionStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hasRequiredCredentials": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "source",
                          "label",
                          "connected",
                          "isActive",
                          "connectionStatus",
                          "hasRequiredCredentials"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pricingRules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "triggerSelector": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "triggerValue": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pricingAction": {
                            "type": "string"
                          },
                          "calculationMethod": {
                            "type": "string"
                          },
                          "value": {
                            "type": "number"
                          },
                          "source": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "category": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingFrequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "priority": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "name",
                          "triggerSelector",
                          "triggerValue",
                          "pricingAction",
                          "calculationMethod",
                          "value",
                          "source",
                          "category",
                          "billingFrequency",
                          "priority",
                          "revision"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pricingRulesSummary": {
                      "type": "object",
                      "properties": {
                        "activeCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "behavior": {
                          "type": "string",
                          "const": "server_applied_on_quote_save"
                        },
                        "appliesTo": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "activeCount",
                        "behavior",
                        "appliesTo"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "orgName",
                    "tier",
                    "defaultMargin",
                    "defaultMarginIsConfigured",
                    "defaultMarginPlatformDefault",
                    "marginFloor",
                    "marginFloorIsConfigured",
                    "marginFloorPlatformDefault",
                    "approvalThreshold",
                    "billingTerms",
                    "billingTermsIsConfigured",
                    "billingTermsPlatformDefault",
                    "hourlyRate",
                    "hourlyRateIsConfigured",
                    "hourlyRateSource",
                    "quotingStyle",
                    "activeDistributors",
                    "configuredDistributorPreferences",
                    "connectedDistributors",
                    "distributorConnectionStatuses",
                    "pricingRules",
                    "pricingRulesSummary"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/memories/search": {
      "get": {
        "operationId": "memory.search",
        "summary": "Recall agent memory",
        "description": "Recalls the durable facts, preferences, instructions, summaries and decisions saved in earlier conversations, most relevant first: the workspace's memories, the signed-in person's own, and a client's when clientId is given. Returns at most limit rows (default 5, at most 20), not a cursor-paged list. retrieval says whether the search ranked by meaning and keywords or by keywords alone, and why. Do not use memory for live org settings, quote defaults, hourly rate, margins, distributors or pricing rules: use org.settings_get.",
        "tags": [
          "memory"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "fact",
                "preference",
                "instruction",
                "summary",
                "decision"
              ]
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "client",
                "user",
                "tenant"
              ]
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 5,
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recall agent memory",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "content": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "fact",
                              "preference",
                              "instruction",
                              "summary",
                              "decision"
                            ]
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "thread",
                              "client",
                              "user",
                              "tenant"
                            ]
                          },
                          "source": {
                            "type": "string"
                          },
                          "provenance": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "relevanceScore": {
                            "type": "number"
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "content",
                          "kind",
                          "scope",
                          "source",
                          "provenance",
                          "relevanceScore",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "retrieval": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string",
                          "enum": [
                            "hybrid",
                            "keyword"
                          ]
                        },
                        "reason": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "embeddings_not_configured",
                                "embeddings_failed"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "mode",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "useInstead": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "org.settings_get"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "retrieval",
                    "useInstead"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/team-members": {
      "get": {
        "operationId": "team_member.list",
        "summary": "List the workspace's team",
        "description": "Lists the people in this workspace with their role, whether their membership is active, their last sign-in, and whether they own the workspace or approve quotes, followed by pending invitations (invited, or expired when past their expiry). People first, then invitations, each by name, paged with an opaque cursor. Capability overrides are not included.",
        "tags": [
          "team_member"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List the workspace's team",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "memberType": {
                            "type": "string",
                            "enum": [
                              "user",
                              "invitation"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "firstName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "jobTitle": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "email": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "inactive",
                              "invited",
                              "expired"
                            ]
                          },
                          "lastLoginAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "invitationId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isQuoteApprover": {
                            "type": "boolean"
                          },
                          "isOwner": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "memberType",
                          "name",
                          "firstName",
                          "lastName",
                          "jobTitle",
                          "email",
                          "role",
                          "status",
                          "lastLoginAt",
                          "invitationId",
                          "expiresAt",
                          "createdAt",
                          "isQuoteApprover",
                          "isOwner"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/team-members/directory": {
      "get": {
        "operationId": "team_member.directory",
        "summary": "List the MSP's team directory",
        "description": "Lists the people who work at this MSP by name: their role, job title, last sign-in and the PSA member they are linked to. People whose membership is not active are left out unless includeInactive is set. isEscalationOwner marks the workspace's admins and owner, which is what escalation means today; escalationOwnersOnly narrows the list to them. Pending invitations are not included.",
        "tags": [
          "team_member"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                }
              ]
            }
          },
          {
            "name": "escalationOwnersOnly",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List the MSP's team directory",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "profileId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "jobTitle": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "role": {
                            "type": "string"
                          },
                          "membershipStatus": {
                            "type": "string"
                          },
                          "isOwner": {
                            "type": "boolean"
                          },
                          "isEscalationOwner": {
                            "type": "boolean"
                          },
                          "lastSignInAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "psaMemberId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "psaIdentifier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "psaMemberIsActive": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "profileId",
                          "name",
                          "email",
                          "jobTitle",
                          "role",
                          "membershipStatus",
                          "isOwner",
                          "isEscalationOwner",
                          "lastSignInAt",
                          "psaMemberId",
                          "psaIdentifier",
                          "psaMemberIsActive"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/permission-groups": {
      "get": {
        "operationId": "permission_group.list",
        "summary": "List permission groups",
        "description": "Lists the workspace's permission groups with their description, how many people belong to each, and the capability overrides each grants or removes for its members. Ordered by name and paged with an opaque cursor.",
        "tags": [
          "permission_group"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List permission groups",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "memberCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "capabilityOverrides": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "capabilityKey": {
                                  "type": "string"
                                },
                                "effect": {
                                  "type": "string",
                                  "enum": [
                                    "allow",
                                    "deny"
                                  ]
                                },
                                "reason": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "capabilityKey",
                                "effect",
                                "reason"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "memberCount",
                          "capabilityOverrides"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quote-branding": {
      "get": {
        "operationId": "quote_branding.get",
        "summary": "Get the workspace's quote branding",
        "description": "Returns the logo, colours, default terms and post-signature copy the workspace's quotes, quote emails and PDFs render with, or branding: null when the workspace has never saved any and the built-in defaults apply.",
        "tags": [
          "quote_branding"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the workspace's quote branding",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "branding": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "logoUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "primaryColor": {
                              "type": "string"
                            },
                            "secondaryColor": {
                              "type": "string"
                            },
                            "accentColor": {
                              "type": "string"
                            },
                            "textColorPrimary": {
                              "type": "string"
                            },
                            "textColorSecondary": {
                              "type": "string"
                            },
                            "defaultTermsMd": {
                              "type": "string"
                            },
                            "defaultExpirationDays": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "emailButtonColor": {
                              "type": "string"
                            },
                            "signatureStrokeColor": {
                              "type": "string"
                            },
                            "postAcceptanceConfirmationHeadline": {
                              "type": "string"
                            },
                            "postAcceptanceNextStepsTitle": {
                              "type": "string"
                            },
                            "postAcceptanceNextStepsMd": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "logoUrl",
                            "primaryColor",
                            "secondaryColor",
                            "accentColor",
                            "textColorPrimary",
                            "textColorSecondary",
                            "defaultTermsMd",
                            "defaultExpirationDays",
                            "emailButtonColor",
                            "signatureStrokeColor",
                            "postAcceptanceConfirmationHeadline",
                            "postAcceptanceNextStepsTitle",
                            "postAcceptanceNextStepsMd",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "branding"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/org/operations": {
      "get": {
        "operationId": "org.operations_get",
        "summary": "Get the workspace's operations settings",
        "description": "Returns the tools the workspace runs (PSA, RMM, endpoint and email security, network monitoring, Liongard, a documentation platform), its managed and professional services pricing models and hourly rate, and its distributors. Each of toolset, pricing and procurement is null until the workspace saves it.",
        "tags": [
          "org"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the workspace's operations settings",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "toolset": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "psa": {
                              "type": "string"
                            },
                            "rmm": {
                              "type": "string"
                            },
                            "endpointSecurity": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "emailSecurity": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "networkMonitoring": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "usesLiongard": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "usesDocumentationPlatform": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "psa",
                            "rmm",
                            "endpointSecurity",
                            "emailSecurity",
                            "networkMonitoring",
                            "usesLiongard",
                            "usesDocumentationPlatform"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pricing": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "managedServicesModels": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "professionalServicesModels": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "hourlyRateUsd": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "hourlyRateUsdExact": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d*)\\.\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "managedServicesModels",
                            "professionalServicesModels",
                            "hourlyRateUsd",
                            "hourlyRateUsdExact"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "procurement": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "distributors": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "distributors"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "toolset",
                    "pricing",
                    "procurement",
                    "revision"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/org/opportunity-defaults": {
      "get": {
        "operationId": "org.opportunity_defaults_get",
        "summary": "Get the workspace's opportunity defaults",
        "description": "Returns how many days from today a new opportunity's expected close date defaults to in this workspace (30 until an admin changes it). Use it to set the expected close date when creating an opportunity the user gave no date for.",
        "tags": [
          "org"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the workspace's opportunity defaults",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "defaultOpportunityCloseDays": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "defaultOpportunityCloseDays"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/org/legal-terms": {
      "get": {
        "operationId": "org.legal_terms_get",
        "summary": "Get the workspace's legal terms",
        "description": "Returns the workspace's own terms and conditions as HTML (null when it hosts none), the link to terms it hosts elsewhere, and the token of the public page customers open from a quote. Use the terms verbatim when drafting quote, proposal, SOW or contract language; do not invent legal terms.",
        "tags": [
          "org"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the workspace's legal terms",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hostedTermsHtml": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publicToken": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "hostedTermsHtml",
                    "externalUrl",
                    "publicToken",
                    "revision"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/org/profile": {
      "get": {
        "operationId": "org.profile_get",
        "summary": "Get the workspace's company profile",
        "description": "Returns the MSP's own company profile: name, email domain, address and phone, company type and size, the onboarding answers it gave, its billing contact, its hourly project rate and quoting style, its external legal terms link, and whether public quotes list a contact's other open quotes.",
        "tags": [
          "org"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the workspace's company profile",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "domain": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "shortName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "employees": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "companyType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "location": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "zipCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "logoUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "logoFilePath": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "email": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "address": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "city": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "state": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "zip": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "country": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "email",
                            "address",
                            "city",
                            "state",
                            "zip",
                            "country"
                          ],
                          "additionalProperties": false
                        },
                        "aiExperienceLevel": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "endpointsManaged": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientsCount": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "howDidYouHear": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "optionalNotes": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "hourlyProjectRate": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "quotingStyle": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "fixed_fee",
                                "t_and_m",
                                "do_not_exceed",
                                "hybrid"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "emailPreferences": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "legalTermsExternalUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "sameContactOpenQuotes": {
                          "type": "boolean"
                        },
                        "onboardingCompletedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "domain",
                        "slug",
                        "shortName",
                        "industry",
                        "employees",
                        "companyType",
                        "phone",
                        "location",
                        "address",
                        "city",
                        "state",
                        "zipCode",
                        "country",
                        "logoUrl",
                        "logoFilePath",
                        "billing",
                        "aiExperienceLevel",
                        "endpointsManaged",
                        "clientsCount",
                        "howDidYouHear",
                        "optionalNotes",
                        "hourlyProjectRate",
                        "quotingStyle",
                        "emailPreferences",
                        "legalTermsExternalUrl",
                        "sameContactOpenQuotes",
                        "onboardingCompletedAt"
                      ],
                      "additionalProperties": false
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "profile",
                    "revision"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/org/domain-claim": {
      "get": {
        "operationId": "org.domain_claim_get",
        "summary": "Get the workspace's domain and its domain check",
        "description": "Returns the workspace's current email domain and its latest domain check: the domain asked for, whether the check is pending, expired or verified, and the DNS TXT record (name and value) that proves it.",
        "tags": [
          "org"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get the workspace's domain and its domain check",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currentDomain": {
                      "type": "string"
                    },
                    "claim": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "domain": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "expired",
                                "verified"
                              ]
                            },
                            "recordName": {
                              "type": "string"
                            },
                            "recordValue": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "expiresAt": {
                              "type": "string"
                            },
                            "verifiedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "domain",
                            "status",
                            "recordName",
                            "recordValue",
                            "createdAt",
                            "expiresAt",
                            "verifiedAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "currentDomain",
                    "claim"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/assessments": {
      "get": {
        "operationId": "assessment.list",
        "summary": "List assessments",
        "description": "Lists the workspace's assessments (QBRs and other assessment types) with their stored data, newest first, optionally for one client or in one status. Paged with an opaque cursor.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "completed",
                "archived"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List assessments",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "url": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "assessmentType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "completedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "data": {}
                        },
                        "required": [
                          "id",
                          "url",
                          "name",
                          "assessmentType",
                          "status",
                          "clientId",
                          "createdAt",
                          "updatedAt",
                          "completedAt",
                          "data"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "assessment.create",
        "summary": "Create an assessment",
        "description": "Creates an assessment (a QBR unless another type is named), optionally for a client of the workspace and from a template, as a draft unless another status is given.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "clientId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "assessmentType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "completed",
                      "archived"
                    ]
                  },
                  "data": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "templateId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "assessment_action",
                      "qbr_publication"
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create an assessment",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "url": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "assessmentType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "clientId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "completedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "data": {},
                    "clientName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "templateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "previousAssessmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sectionCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "shareToken": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "shareTokenRevokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "url",
                    "name",
                    "assessmentType",
                    "status",
                    "clientId",
                    "createdAt",
                    "updatedAt",
                    "completedAt",
                    "data",
                    "clientName",
                    "templateId",
                    "previousAssessmentId",
                    "sectionCount",
                    "shareToken",
                    "shareTokenRevokedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/assessments/{assessmentId}": {
      "get": {
        "operationId": "assessment.get",
        "summary": "Get an assessment",
        "description": "Returns one assessment with its stored data, client, template, section count, and its share link token while the link is live.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "assessmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get an assessment",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "url": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "assessmentType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "clientId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "completedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "data": {},
                    "clientName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "templateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "previousAssessmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sectionCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "shareToken": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "shareTokenRevokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "url",
                    "name",
                    "assessmentType",
                    "status",
                    "clientId",
                    "createdAt",
                    "updatedAt",
                    "completedAt",
                    "data",
                    "clientName",
                    "templateId",
                    "previousAssessmentId",
                    "sectionCount",
                    "shareToken",
                    "shareTokenRevokedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "assessment.update",
        "summary": "Update an assessment",
        "description": "Changes an assessment's name, client, type, status, template, completion time, or data. `data` replaces the stored data whole.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "assessmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "clientId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "assessmentType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "completed",
                      "archived"
                    ]
                  },
                  "data": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "templateId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "completedAt": {
                    "anyOf": [
                      {
                        "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)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update an assessment",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "url": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "assessmentType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "clientId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "completedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "data": {},
                    "clientName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "templateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "previousAssessmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sectionCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "shareToken": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "shareTokenRevokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "url",
                    "name",
                    "assessmentType",
                    "status",
                    "clientId",
                    "createdAt",
                    "updatedAt",
                    "completedAt",
                    "data",
                    "clientName",
                    "templateId",
                    "previousAssessmentId",
                    "sectionCount",
                    "shareToken",
                    "shareTokenRevokedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "assessment.delete",
        "summary": "Delete an assessment",
        "description": "Permanently deletes an assessment, its data and its QBR publications, drafts and published links alike, so a link a client holds stops working. A later assessment that named it as its previous review keeps its row with that reference cleared. Prefer assessment.archive, which can be undone.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "assessmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete an assessment",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assessmentId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "assessmentId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/assessments/{assessmentId}/sections": {
      "get": {
        "operationId": "assessment.sections_get",
        "summary": "Get an assessment's sections",
        "description": "Returns an assessment's sections as the assessment editor stores them, with the whole of its stored data.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "assessmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get an assessment's sections",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assessmentId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "assessmentName": {
                      "type": "string"
                    },
                    "sections": {
                      "type": "array",
                      "items": {}
                    },
                    "data": {}
                  },
                  "required": [
                    "assessmentId",
                    "assessmentName",
                    "sections",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/assessments/{assessmentId}/share-token": {
      "post": {
        "operationId": "assessment.share_token_generate",
        "summary": "Generate an assessment's share token",
        "description": "Issues a new share link token for an assessment, replacing any earlier one and lifting a revocation. The link opens the assessment for signed-in members of the assessment's workspace. The token alone does not give access to anyone else.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "assessmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generate an assessment's share token",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assessmentId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "shareToken": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "assessmentId",
                    "shareToken"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/assessments/{assessmentId}/share-token/revoke": {
      "post": {
        "operationId": "assessment.share_token_revoke",
        "summary": "Revoke an assessment's share token",
        "description": "Revokes an assessment's share link, so its token no longer opens the assessment.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "assessmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoke an assessment's share token",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assessmentId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "revokedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "assessmentId",
                    "revokedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/assessments/{assessmentId}/archive": {
      "post": {
        "operationId": "assessment.archive",
        "summary": "Archive an assessment",
        "description": "Archives an assessment (sets its status to archived) and revokes its share link. The assessment stays readable and can be set back to another status with assessment.update. An assessment that is already archived answers with its current state.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "assessmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Archive an assessment",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "url": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "assessmentType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "clientId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "completedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "data": {},
                    "clientName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "templateId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "previousAssessmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sectionCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "shareToken": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "shareTokenRevokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "url",
                    "name",
                    "assessmentType",
                    "status",
                    "clientId",
                    "createdAt",
                    "updatedAt",
                    "completedAt",
                    "data",
                    "clientName",
                    "templateId",
                    "previousAssessmentId",
                    "sectionCount",
                    "shareToken",
                    "shareTokenRevokedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/qbr-financial-stats": {
      "get": {
        "operationId": "assessment.client_financial_stats",
        "summary": "Get a client's QBR financial stats",
        "description": "Counts a client's open pipeline (active opportunities expected to close in the period) and closed-won business (opportunities in a closed-won stage that closed in the period), with their forecast value, for a QBR's reporting period. Without a period, every opportunity counts.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "periodStart",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "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])))$"
            }
          },
          {
            "name": "periodEnd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "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])))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a client's QBR financial stats",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "openCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "openValue": {
                      "type": "number"
                    },
                    "closedWonCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "closedWonValue": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "openCount",
                    "openValue",
                    "closedWonCount",
                    "closedWonValue"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-templates": {
      "get": {
        "operationId": "qbr_template.list",
        "summary": "List QBR templates",
        "description": "Lists the workspace's QBR templates, deck and web, with their sections, newest first and paged with an opaque cursor. Each template's sections are the cards a QBR created from it starts with.",
        "tags": [
          "qbr_template"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List QBR templates",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "deliveryType": {
                            "type": "string",
                            "enum": [
                              "deck",
                              "web"
                            ]
                          },
                          "isDefault": {
                            "type": "boolean"
                          },
                          "sections": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "sectionType": {
                                  "type": "string"
                                },
                                "order": {
                                  "type": "number"
                                },
                                "config": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                }
                              },
                              "required": [
                                "sectionType",
                                "order",
                                "config"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "layout": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "brandTokens": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "starterKey": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "defaultExpiryDays": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "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)))$"
                          },
                          "updatedAt": {
                            "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": [
                          "id",
                          "name",
                          "description",
                          "deliveryType",
                          "isDefault",
                          "sections",
                          "layout",
                          "brandTokens",
                          "starterKey",
                          "defaultExpiryDays",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-templates/defaults": {
      "get": {
        "operationId": "qbr_template.list_defaults",
        "summary": "List Scopable's starting QBR templates",
        "description": "Lists the platform's read-only QBR templates, by name, which a workspace copies to start its own. They are the same for every workspace.",
        "tags": [
          "qbr_template"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "List Scopable's starting QBR templates",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sections": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "sectionType": {
                                  "type": "string"
                                },
                                "order": {
                                  "type": "number"
                                },
                                "config": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                }
                              },
                              "required": [
                                "sectionType",
                                "order",
                                "config"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "createdAt": {
                            "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": [
                          "id",
                          "name",
                          "description",
                          "sections",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "templates"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-templates/{templateId}": {
      "get": {
        "operationId": "qbr_template.get",
        "summary": "Get a QBR template",
        "description": "Returns one of the workspace's QBR templates with its sections.",
        "tags": [
          "qbr_template"
        ],
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a QBR template",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "template": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "deliveryType": {
                          "type": "string",
                          "enum": [
                            "deck",
                            "web"
                          ]
                        },
                        "isDefault": {
                          "type": "boolean"
                        },
                        "sections": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "sectionType": {
                                "type": "string"
                              },
                              "order": {
                                "type": "number"
                              },
                              "config": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              }
                            },
                            "required": [
                              "sectionType",
                              "order",
                              "config"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "layout": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "brandTokens": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "starterKey": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "defaultExpiryDays": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "name",
                        "description",
                        "deliveryType",
                        "isDefault",
                        "sections",
                        "layout",
                        "brandTokens",
                        "starterKey",
                        "defaultExpiryDays",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "template"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/gamma-deck-shares": {
      "get": {
        "operationId": "gamma_deck_share.list",
        "summary": "List deck download links",
        "description": "Lists the workspace's links for downloading exported QBR decks, draft, published and revoked, most recently changed first and paged with an opaque cursor. A link's token is never listed.",
        "tags": [
          "gamma_deck_share"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List deck download links",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "deckJobId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "draft",
                              "published",
                              "revoked"
                            ]
                          },
                          "publishedAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expiresAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "revokedAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "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)))$"
                          },
                          "updatedAt": {
                            "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": [
                          "id",
                          "deckJobId",
                          "status",
                          "publishedAt",
                          "expiresAt",
                          "revokedAt",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "gamma_deck_share.create",
        "summary": "Create a draft deck download link",
        "description": "Creates a draft download link for a finished QBR deck export. Nobody can open it until it is published. Answers with the draft.",
        "tags": [
          "gamma_deck_share"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "deckJobId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "deckJobId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a draft deck download link",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "share": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "deckJobId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "published",
                            "revoked"
                          ]
                        },
                        "publishedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "deckJobId",
                        "status",
                        "publishedAt",
                        "expiresAt",
                        "revokedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "share"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/gamma-deck-shares/{shareId}": {
      "get": {
        "operationId": "gamma_deck_share.get",
        "summary": "Get a deck download link",
        "description": "Returns one of the workspace's deck download links: its deck export, status and dates, never its token.",
        "tags": [
          "gamma_deck_share"
        ],
        "parameters": [
          {
            "name": "shareId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a deck download link",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "share": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "deckJobId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "published",
                            "revoked"
                          ]
                        },
                        "publishedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "deckJobId",
                        "status",
                        "publishedAt",
                        "expiresAt",
                        "revokedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "share"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/gamma-deck-shares/{shareId}/publish": {
      "post": {
        "operationId": "gamma_deck_share.publish",
        "summary": "Publish a deck download link",
        "description": "Publishes a draft deck download link: anyone with the returned link can download the deck until it is revoked. The link does not expire. The token is shown only in this answer. Only a draft can be published.",
        "tags": [
          "gamma_deck_share"
        ],
        "parameters": [
          {
            "name": "shareId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Publish a deck download link",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "share": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "deckJobId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "published",
                            "revoked"
                          ]
                        },
                        "publishedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "deckJobId",
                        "status",
                        "publishedAt",
                        "expiresAt",
                        "revokedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "token": {
                      "type": "string"
                    },
                    "portalUrl": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "share",
                    "token",
                    "portalUrl"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/gamma-deck-shares/{shareId}/revoke": {
      "post": {
        "operationId": "gamma_deck_share.revoke",
        "summary": "Revoke a deck download link",
        "description": "Revokes a published deck download link so it stops working at once. A revoked link cannot be published again. Answers with the link.",
        "tags": [
          "gamma_deck_share"
        ],
        "parameters": [
          {
            "name": "shareId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoke a deck download link",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "share": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "deckJobId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "published",
                            "revoked"
                          ]
                        },
                        "publishedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "deckJobId",
                        "status",
                        "publishedAt",
                        "expiresAt",
                        "revokedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "share"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/gamma-deck-exports/{jobId}": {
      "get": {
        "operationId": "gamma_deck_export.get",
        "summary": "Get a presentation export",
        "description": "Returns a presentation export's status. While Gamma is generating it, each read checks on it and, when it is ready, stores the file. A completed export carries a link that downloads the deck for an hour.",
        "tags": [
          "gamma_deck_export"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a presentation export",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "creating",
                        "pending",
                        "completed",
                        "failed",
                        "cancelled",
                        "expired"
                      ]
                    },
                    "downloadUrl": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "filename": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "errorCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "errorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "jobId",
                    "status",
                    "downloadUrl",
                    "filename",
                    "errorCode",
                    "errorMessage"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-working-documents/{documentId}": {
      "get": {
        "operationId": "qbr_working_document.get",
        "summary": "Get a QBR working document",
        "description": "Returns one of the workspace's QBR working documents with its cards in order: each card's layout, authored content, visibility and the data snapshot stored when it was last resolved.",
        "tags": [
          "qbr_working_document"
        ],
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a QBR working document",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "document": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "templateId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "title": {
                          "type": "string"
                        },
                        "reportingPeriodStart": {
                          "type": "string",
                          "format": "date",
                          "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])))$"
                        },
                        "reportingPeriodEnd": {
                          "type": "string",
                          "format": "date",
                          "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])))$"
                        },
                        "deliveryType": {
                          "type": "string",
                          "enum": [
                            "deck",
                            "web"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "archived"
                          ]
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "clientId",
                        "templateId",
                        "title",
                        "reportingPeriodStart",
                        "reportingPeriodEnd",
                        "deliveryType",
                        "status",
                        "version",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "cardType": {
                            "type": "string"
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "configuration": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "authoredContent": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "isVisible": {
                            "type": "boolean"
                          },
                          "sourceState": {
                            "type": "string",
                            "enum": [
                              "not_connected",
                              "connected_no_data",
                              "available",
                              "failed"
                            ]
                          },
                          "resolvedPayload": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "capturedAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "updatedAt": {
                            "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": [
                          "id",
                          "cardType",
                          "position",
                          "configuration",
                          "authoredContent",
                          "isVisible",
                          "sourceState",
                          "resolvedPayload",
                          "capturedAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "document",
                    "cards"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "qbr_working_document.update",
        "summary": "Update a QBR working document",
        "description": "Changes a QBR working document's title, its cards (order, layout, authored content and visibility) or both, in one change. Cards, when sent, must be every card of the document. The version must be the one last read; if the document changed since, the answer is a conflict naming the current version and nothing is saved. Card data snapshots are not changed; refresh a card for that.",
        "tags": [
          "qbr_working_document"
        ],
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "version": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "cards": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "position": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 999
                        },
                        "configuration": {
                          "type": "object",
                          "properties": {
                            "layout": {
                              "type": "object",
                              "properties": {
                                "x": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 11
                                },
                                "y": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 1000
                                },
                                "w": {
                                  "type": "integer",
                                  "minimum": 3,
                                  "maximum": 12
                                },
                                "h": {
                                  "type": "integer",
                                  "minimum": 3,
                                  "maximum": 1000
                                }
                              },
                              "required": [
                                "x",
                                "y",
                                "w",
                                "h"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        },
                        "authoredContent": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {},
                          "description": "At most 65536 bytes as JSON."
                        },
                        "isVisible": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "position",
                        "configuration",
                        "authoredContent",
                        "isVisible"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "version"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a QBR working document",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "document": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "templateId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "title": {
                          "type": "string"
                        },
                        "reportingPeriodStart": {
                          "type": "string",
                          "format": "date",
                          "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])))$"
                        },
                        "reportingPeriodEnd": {
                          "type": "string",
                          "format": "date",
                          "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])))$"
                        },
                        "deliveryType": {
                          "type": "string",
                          "enum": [
                            "deck",
                            "web"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "archived"
                          ]
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "clientId",
                        "templateId",
                        "title",
                        "reportingPeriodStart",
                        "reportingPeriodEnd",
                        "deliveryType",
                        "status",
                        "version",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "cardType": {
                            "type": "string"
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "configuration": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "authoredContent": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "isVisible": {
                            "type": "boolean"
                          },
                          "sourceState": {
                            "type": "string",
                            "enum": [
                              "not_connected",
                              "connected_no_data",
                              "available",
                              "failed"
                            ]
                          },
                          "resolvedPayload": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "capturedAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "updatedAt": {
                            "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": [
                          "id",
                          "cardType",
                          "position",
                          "configuration",
                          "authoredContent",
                          "isVisible",
                          "sourceState",
                          "resolvedPayload",
                          "capturedAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "document",
                    "cards"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-working-documents": {
      "post": {
        "operationId": "qbr_working_document.create",
        "summary": "Create a QBR working document",
        "description": "Starts a QBR for a client and reporting period from one of the workspace's templates: copies the template's client-safe cards and resolves each card's data (agreements, devices, endpoint posture, Microsoft 365 MFA, ticket sentiment) into a stored snapshot. Answers with the document and its cards.",
        "tags": [
          "qbr_working_document"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "templateId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "reportingPeriodStart": {
                    "type": "string",
                    "format": "date",
                    "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])))$"
                  },
                  "reportingPeriodEnd": {
                    "type": "string",
                    "format": "date",
                    "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])))$"
                  }
                },
                "required": [
                  "clientId",
                  "templateId",
                  "title",
                  "reportingPeriodStart",
                  "reportingPeriodEnd"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a QBR working document",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "document": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "templateId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "title": {
                          "type": "string"
                        },
                        "reportingPeriodStart": {
                          "type": "string",
                          "format": "date",
                          "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])))$"
                        },
                        "reportingPeriodEnd": {
                          "type": "string",
                          "format": "date",
                          "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])))$"
                        },
                        "deliveryType": {
                          "type": "string",
                          "enum": [
                            "deck",
                            "web"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "archived"
                          ]
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "clientId",
                        "templateId",
                        "title",
                        "reportingPeriodStart",
                        "reportingPeriodEnd",
                        "deliveryType",
                        "status",
                        "version",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "cardType": {
                            "type": "string"
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "configuration": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "authoredContent": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "isVisible": {
                            "type": "boolean"
                          },
                          "sourceState": {
                            "type": "string",
                            "enum": [
                              "not_connected",
                              "connected_no_data",
                              "available",
                              "failed"
                            ]
                          },
                          "resolvedPayload": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "capturedAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "updatedAt": {
                            "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": [
                          "id",
                          "cardType",
                          "position",
                          "configuration",
                          "authoredContent",
                          "isVisible",
                          "sourceState",
                          "resolvedPayload",
                          "capturedAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "document",
                    "cards"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-working-documents/{documentId}/cards/{cardId}/refresh": {
      "post": {
        "operationId": "qbr_working_document.refresh_card",
        "summary": "Refresh a QBR card's data",
        "description": "Resolves one card of a QBR working document again from the workspace's current records, for the document's client and reporting period, and replaces its stored data snapshot. Authored content, layout and visibility are kept. Answers with the document and its cards.",
        "tags": [
          "qbr_working_document"
        ],
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "cardId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refresh a QBR card's data",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "document": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "templateId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "title": {
                          "type": "string"
                        },
                        "reportingPeriodStart": {
                          "type": "string",
                          "format": "date",
                          "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])))$"
                        },
                        "reportingPeriodEnd": {
                          "type": "string",
                          "format": "date",
                          "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])))$"
                        },
                        "deliveryType": {
                          "type": "string",
                          "enum": [
                            "deck",
                            "web"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "archived"
                          ]
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "clientId",
                        "templateId",
                        "title",
                        "reportingPeriodStart",
                        "reportingPeriodEnd",
                        "deliveryType",
                        "status",
                        "version",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "cardType": {
                            "type": "string"
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "configuration": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "authoredContent": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "isVisible": {
                            "type": "boolean"
                          },
                          "sourceState": {
                            "type": "string",
                            "enum": [
                              "not_connected",
                              "connected_no_data",
                              "available",
                              "failed"
                            ]
                          },
                          "resolvedPayload": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "capturedAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "updatedAt": {
                            "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": [
                          "id",
                          "cardType",
                          "position",
                          "configuration",
                          "authoredContent",
                          "isVisible",
                          "sourceState",
                          "resolvedPayload",
                          "capturedAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "document",
                    "cards"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/qbr-publications": {
      "get": {
        "operationId": "qbr_publication.list",
        "summary": "List a client's QBR publications",
        "description": "Lists the workspace's published-QBR records for one client, draft, published and revoked, most recently changed first and paged with an opaque cursor. A publication's link token is never listed.",
        "tags": [
          "qbr_publication"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's QBR publications",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "assessmentId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "workingDocumentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "title": {
                            "type": "string"
                          },
                          "reportingPeriodStart": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date",
                                "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])))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "reportingPeriodEnd": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date",
                                "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])))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "draft",
                              "published",
                              "revoked"
                            ]
                          },
                          "publishedAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expiresAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "revokedAt": {
                            "anyOf": [
                              {
                                "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)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "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)))$"
                          },
                          "updatedAt": {
                            "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": [
                          "id",
                          "assessmentId",
                          "workingDocumentId",
                          "clientId",
                          "clientName",
                          "title",
                          "reportingPeriodStart",
                          "reportingPeriodEnd",
                          "status",
                          "publishedAt",
                          "expiresAt",
                          "revokedAt",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-publications/{publicationId}": {
      "get": {
        "operationId": "qbr_publication.get",
        "summary": "Get a QBR publication",
        "description": "Returns one of the workspace's QBR publications: its client, assessment, status and dates, never its link token.",
        "tags": [
          "qbr_publication"
        ],
        "parameters": [
          {
            "name": "publicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a QBR publication",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "publication": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "assessmentId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "workingDocumentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": "string"
                        },
                        "reportingPeriodStart": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date",
                              "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])))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reportingPeriodEnd": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date",
                              "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])))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "published",
                            "revoked"
                          ]
                        },
                        "publishedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "assessmentId",
                        "workingDocumentId",
                        "clientId",
                        "clientName",
                        "title",
                        "reportingPeriodStart",
                        "reportingPeriodEnd",
                        "status",
                        "publishedAt",
                        "expiresAt",
                        "revokedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "publication"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-publications": {
      "post": {
        "operationId": "qbr_publication.create",
        "summary": "Create a draft QBR publication",
        "description": "Creates a draft publication of a QBR for a client: from an existing QBR assessment, or from a new draft assessment with the default dashboard cards. With a working document, that document's cards are what publishing freezes into the link. Nobody can open a draft. Answers with the draft.",
        "tags": [
          "qbr_publication"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "assessmentId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "reportingPeriodStart": {
                    "type": "string",
                    "format": "date",
                    "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])))$"
                  },
                  "reportingPeriodEnd": {
                    "type": "string",
                    "format": "date",
                    "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])))$"
                  },
                  "workingDocumentId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a draft QBR publication",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "publication": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "assessmentId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "workingDocumentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": "string"
                        },
                        "reportingPeriodStart": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date",
                              "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])))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reportingPeriodEnd": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date",
                              "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])))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "published",
                            "revoked"
                          ]
                        },
                        "publishedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "assessmentId",
                        "workingDocumentId",
                        "clientId",
                        "clientName",
                        "title",
                        "reportingPeriodStart",
                        "reportingPeriodEnd",
                        "status",
                        "publishedAt",
                        "expiresAt",
                        "revokedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "publication"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-publications/{publicationId}/publish": {
      "post": {
        "operationId": "qbr_publication.publish",
        "summary": "Publish a QBR",
        "description": "Publishes a draft QBR publication: anyone with the returned link can open the QBR until it is revoked. The link does not expire. A publication made from a working document freezes that document's cards now; later edits do not reach the link. The token is shown only in this answer. Only a draft can be published.",
        "tags": [
          "qbr_publication"
        ],
        "parameters": [
          {
            "name": "publicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Publish a QBR",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "publication": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "assessmentId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "workingDocumentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": "string"
                        },
                        "reportingPeriodStart": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date",
                              "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])))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reportingPeriodEnd": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date",
                              "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])))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "published",
                            "revoked"
                          ]
                        },
                        "publishedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "assessmentId",
                        "workingDocumentId",
                        "clientId",
                        "clientName",
                        "title",
                        "reportingPeriodStart",
                        "reportingPeriodEnd",
                        "status",
                        "publishedAt",
                        "expiresAt",
                        "revokedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "token": {
                      "type": "string"
                    },
                    "portalUrl": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "publication",
                    "token",
                    "portalUrl"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-publications/{publicationId}/revoke": {
      "post": {
        "operationId": "qbr_publication.revoke",
        "summary": "Revoke a published QBR",
        "description": "Revokes a published QBR's link so it stops working at once. A revoked publication cannot be published again. Answers with the publication.",
        "tags": [
          "qbr_publication"
        ],
        "parameters": [
          {
            "name": "publicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoke a published QBR",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "publication": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "assessmentId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "workingDocumentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": "string"
                        },
                        "reportingPeriodStart": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date",
                              "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])))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reportingPeriodEnd": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date",
                              "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])))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "published",
                            "revoked"
                          ]
                        },
                        "publishedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "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)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "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)))$"
                        },
                        "updatedAt": {
                          "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": [
                        "id",
                        "assessmentId",
                        "workingDocumentId",
                        "clientId",
                        "clientName",
                        "title",
                        "reportingPeriodStart",
                        "reportingPeriodEnd",
                        "status",
                        "publishedAt",
                        "expiresAt",
                        "revokedAt",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "publication"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-publications/{publicationId}/deliver": {
      "post": {
        "operationId": "qbr_publication.deliver",
        "summary": "Email a published QBR's link",
        "description": "Requests one email per recipient carrying the published QBR's portal link. Send the token qbr_publication.publish answered; only an active published QBR can be delivered, to at most 20 recipients. Repeating a deliveryAttemptId requests no duplicate email for the same recipient. Acceptance does not confirm delivery to the recipient's inbox.",
        "tags": [
          "qbr_publication"
        ],
        "parameters": [
          {
            "name": "publicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "recipientEmails": {
                    "minItems": 1,
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 320,
                      "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                    }
                  },
                  "deliveryAttemptId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "token",
                  "recipientEmails",
                  "deliveryAttemptId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email a published QBR's link",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deliveryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      }
                    }
                  },
                  "required": [
                    "deliveryIds"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/gaps/{gapId}": {
      "patch": {
        "operationId": "compliance.gap_update",
        "summary": "Update a compliance gap",
        "description": "Changes a compliance gap's title, description, severity, status, chosen action, action reference or recommendation; fields left out keep their value. Moving it to resolved or accepted stamps when, and by whom when named. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "gapId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "severity": {
                    "type": "string",
                    "enum": [
                      "critical",
                      "high",
                      "medium",
                      "low"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "in_progress",
                      "resolved",
                      "accepted"
                    ]
                  },
                  "actionType": {
                    "type": "string",
                    "enum": [
                      "ticket",
                      "quote",
                      "flagged",
                      "no_action"
                    ]
                  },
                  "actionReferenceId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "recommendation": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "resolvedBy": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a compliance gap",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "controlId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "frameworkId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "critical",
                            "high",
                            "medium",
                            "low"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "open",
                            "in_progress",
                            "resolved",
                            "accepted"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "actionType": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "ticket",
                            "quote",
                            "flagged",
                            "no_action"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "actionReferenceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "recommendation": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "identifiedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvalStatus": {
                      "type": "string",
                      "enum": [
                        "needs_review",
                        "reviewed",
                        "approved",
                        "rejected",
                        "changes_requested"
                      ]
                    },
                    "approvalReviewedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalReviewedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvalApprovedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalApprovedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "controlId",
                    "frameworkId",
                    "title",
                    "description",
                    "severity",
                    "status",
                    "actionType",
                    "actionReferenceId",
                    "recommendation",
                    "identifiedAt",
                    "resolvedAt",
                    "resolvedBy",
                    "approvalStatus",
                    "approvalReviewedAt",
                    "approvalReviewedBy",
                    "approvalApprovedAt",
                    "approvalApprovedBy",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "compliance.gap_delete",
        "summary": "Delete a compliance gap",
        "description": "Permanently deletes a compliance gap. Its exceptions go with it; action plans and action-log entries that named it keep their rows with the reference cleared. The deletion is written to the client's compliance action log. Resolving or accepting the gap keeps its history instead.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "gapId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete a compliance gap",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "gapId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "gapId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/gaps/bulk-status": {
      "post": {
        "operationId": "compliance.gap_status_bulk_update",
        "summary": "Set the status of many compliance gaps",
        "description": "Sets one status on up to a thousand compliance gaps, stamping resolution time for resolved or accepted, and writes an action-log entry per gap. Ids that are not the workspace's gaps are skipped; the answer names the gaps that changed.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "gapIds": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "in_progress",
                      "resolved",
                      "accepted"
                    ]
                  }
                },
                "required": [
                  "gapIds",
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set the status of many compliance gaps",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "gapIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      }
                    }
                  },
                  "required": [
                    "gapIds"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/gaps/bulk-action-batches": {
      "post": {
        "operationId": "compliance.gap_bulk_action_stage",
        "summary": "Stage compliance gaps for bulk action",
        "description": "Stages up to a hundred compliance gaps as one batch for their chosen actions and answers the batch grouped by action. It records the batch in the compliance action log and changes no gap; nothing leaves Scopable. Every gap must be the workspace's.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "gapIds": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  }
                },
                "required": [
                  "gapIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stage compliance gaps for bulk action",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batchId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "totalCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "actionType": {
                            "type": "string",
                            "enum": [
                              "ticket",
                              "quote",
                              "flagged",
                              "no_action"
                            ]
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "clientCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "criticalCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "highCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "actionType",
                          "count",
                          "clientCount",
                          "criticalCount",
                          "highCount"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "batchId",
                    "totalCount",
                    "groups"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/risks": {
      "get": {
        "operationId": "compliance.risk_list",
        "summary": "List a client's risk register",
        "description": "Lists one client's risk register, highest risk score first, optionally by status. The score is the stored likelihood times impact, and each risk carries its owner's name. A client in another workspace is not found.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "mitigated",
                "closed",
                "accepted"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's risk register",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "category": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "likelihood": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "impact": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "riskScore": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "treatment": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "accept",
                                  "mitigate",
                                  "transfer",
                                  "avoid"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "treatmentNotes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ownerId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "linkedGapIds": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "open",
                              "mitigated",
                              "closed",
                              "accepted"
                            ]
                          },
                          "reviewDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "createdBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ownerName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "title",
                          "description",
                          "category",
                          "likelihood",
                          "impact",
                          "riskScore",
                          "treatment",
                          "treatmentNotes",
                          "ownerId",
                          "linkedGapIds",
                          "status",
                          "reviewDate",
                          "createdAt",
                          "updatedAt",
                          "createdBy",
                          "ownerName"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/risks": {
      "post": {
        "operationId": "compliance.risk_create",
        "summary": "Add a risk to a client's risk register",
        "description": "Adds an open risk to a client's risk register, rated by likelihood and impact from 1 to 5, optionally with a description, category, treatment, treatment notes and review date. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "likelihood": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  },
                  "impact": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "treatment": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "accept",
                          "mitigate",
                          "transfer",
                          "avoid"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "treatmentNotes": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "reviewDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date",
                        "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])))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "title",
                  "likelihood",
                  "impact"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add a risk to a client's risk register",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "category": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "likelihood": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "impact": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "riskScore": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "treatment": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "accept",
                            "mitigate",
                            "transfer",
                            "avoid"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "treatmentNotes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ownerId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "linkedGapIds": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "mitigated",
                        "closed",
                        "accepted"
                      ]
                    },
                    "reviewDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "title",
                    "description",
                    "category",
                    "likelihood",
                    "impact",
                    "riskScore",
                    "treatment",
                    "treatmentNotes",
                    "ownerId",
                    "linkedGapIds",
                    "status",
                    "reviewDate",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/risks/{riskId}": {
      "patch": {
        "operationId": "compliance.risk_update",
        "summary": "Update a risk in a client's risk register",
        "description": "Changes a risk's title, description, category, likelihood, impact, treatment, treatment notes, status or review date; fields left out keep their value. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "riskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "likelihood": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  },
                  "impact": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  },
                  "treatment": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "accept",
                          "mitigate",
                          "transfer",
                          "avoid"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "treatmentNotes": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "mitigated",
                      "closed",
                      "accepted"
                    ]
                  },
                  "reviewDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date",
                        "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])))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a risk in a client's risk register",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "category": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "likelihood": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "impact": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "riskScore": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "treatment": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "accept",
                            "mitigate",
                            "transfer",
                            "avoid"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "treatmentNotes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ownerId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "linkedGapIds": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "mitigated",
                        "closed",
                        "accepted"
                      ]
                    },
                    "reviewDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "title",
                    "description",
                    "category",
                    "likelihood",
                    "impact",
                    "riskScore",
                    "treatment",
                    "treatmentNotes",
                    "ownerId",
                    "linkedGapIds",
                    "status",
                    "reviewDate",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "compliance.risk_delete",
        "summary": "Delete a risk from a client's risk register",
        "description": "Permanently deletes a risk from a client's risk register. The deletion, with the risk's title, status and ratings, is written to the client's compliance action log. Closing or accepting the risk keeps it instead.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "riskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete a risk from a client's risk register",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "riskId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "riskId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/policies": {
      "post": {
        "operationId": "compliance.policy_create",
        "summary": "Add a policy to a client's policy library",
        "description": "Adds a policy document to a client's policy library: its name and type, optionally a status (draft by default), version (1.0 by default), review date, content, the controls it satisfies and the evidence artifact that holds it. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "policyType": {
                    "type": "string",
                    "enum": [
                      "AUP",
                      "IR",
                      "DataClassification",
                      "AccessControl",
                      "ChangeManagement",
                      "BCPDR",
                      "PasswordPolicy",
                      "RemoteWork",
                      "VendorManagement"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "active",
                      "under_review",
                      "retired"
                    ]
                  },
                  "version": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "reviewDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date",
                        "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])))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "content": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "linkedControlIds": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "evidenceArtifactId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "name",
                  "policyType"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add a policy to a client's policy library",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "policyType": {
                      "type": "string",
                      "enum": [
                        "AUP",
                        "IR",
                        "DataClassification",
                        "AccessControl",
                        "ChangeManagement",
                        "BCPDR",
                        "PasswordPolicy",
                        "RemoteWork",
                        "VendorManagement"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "active",
                        "under_review",
                        "retired"
                      ]
                    },
                    "version": {
                      "type": "string"
                    },
                    "reviewDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "content": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "linkedControlIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      }
                    },
                    "evidenceArtifactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "name",
                    "policyType",
                    "status",
                    "version",
                    "reviewDate",
                    "content",
                    "linkedControlIds",
                    "evidenceArtifactId",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/policies/{policyId}": {
      "patch": {
        "operationId": "compliance.policy_update",
        "summary": "Update a policy in a client's policy library",
        "description": "Changes a policy's name, type, status, version, review date, content, linked controls or evidence artifact; fields left out keep their value, and a list of controls replaces the old one. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "policyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "policyType": {
                    "type": "string",
                    "enum": [
                      "AUP",
                      "IR",
                      "DataClassification",
                      "AccessControl",
                      "ChangeManagement",
                      "BCPDR",
                      "PasswordPolicy",
                      "RemoteWork",
                      "VendorManagement"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "active",
                      "under_review",
                      "retired"
                    ]
                  },
                  "version": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "reviewDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date",
                        "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])))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "content": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "linkedControlIds": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "evidenceArtifactId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a policy in a client's policy library",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "policyType": {
                      "type": "string",
                      "enum": [
                        "AUP",
                        "IR",
                        "DataClassification",
                        "AccessControl",
                        "ChangeManagement",
                        "BCPDR",
                        "PasswordPolicy",
                        "RemoteWork",
                        "VendorManagement"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "active",
                        "under_review",
                        "retired"
                      ]
                    },
                    "version": {
                      "type": "string"
                    },
                    "reviewDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "content": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "linkedControlIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      }
                    },
                    "evidenceArtifactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "name",
                    "policyType",
                    "status",
                    "version",
                    "reviewDate",
                    "content",
                    "linkedControlIds",
                    "evidenceArtifactId",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "compliance.policy_delete",
        "summary": "Delete a policy from a client's policy library",
        "description": "Permanently deletes a policy from a client's policy library; its evidence artifact stays. The deletion, with the policy's name, type, status and version, is written to the client's compliance action log. Retiring the policy keeps it instead.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "policyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete a policy from a client's policy library",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "policyId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "policyId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/vendors": {
      "post": {
        "operationId": "compliance.vendor_create",
        "summary": "Add a vendor to a client's third-party risk register",
        "description": "Adds a vendor to a client's third-party risk register: its name, criticality, category, certifications, risk score, status, website and notes. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "criticality": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high",
                      "critical"
                    ]
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "certifications": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "expiryDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "expired",
                            "pending"
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "status"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "riskScore": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "under_review",
                      "suspended",
                      "terminated"
                    ]
                  },
                  "website": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 50000
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add a vendor to a client's third-party risk register",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "criticality": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "critical"
                      ]
                    },
                    "category": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "certifications": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "expiryDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "expired",
                              "pending"
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "expiryDate",
                          "status"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "riskScore": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "under_review",
                        "suspended",
                        "terminated"
                      ]
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "notes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "name",
                    "criticality",
                    "category",
                    "certifications",
                    "riskScore",
                    "status",
                    "website",
                    "notes",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/vendors/{vendorId}": {
      "patch": {
        "operationId": "compliance.vendor_update",
        "summary": "Update a vendor in a client's risk register",
        "description": "Changes a vendor's name, criticality, category, certifications, risk score, status, website or notes; fields left out keep their value. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "criticality": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high",
                      "critical"
                    ]
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "certifications": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "expiryDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "expired",
                            "pending"
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "status"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "riskScore": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "under_review",
                      "suspended",
                      "terminated"
                    ]
                  },
                  "website": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 50000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a vendor in a client's risk register",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "criticality": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "critical"
                      ]
                    },
                    "category": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "certifications": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "expiryDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "expired",
                              "pending"
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "expiryDate",
                          "status"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "riskScore": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "under_review",
                        "suspended",
                        "terminated"
                      ]
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "notes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "name",
                    "criticality",
                    "category",
                    "certifications",
                    "riskScore",
                    "status",
                    "website",
                    "notes",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "compliance.vendor_delete",
        "summary": "Delete a vendor from a client's risk register",
        "description": "Permanently deletes a vendor with its assessments and the evidence filed against them, auditor links to that evidence included. Refused while any of that evidence carries recorded approval decisions. The deletion is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete a vendor from a client's risk register",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vendorId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "vendorId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/vendors/{vendorId}/assessments": {
      "post": {
        "operationId": "compliance.vendor_assessment_create",
        "summary": "Record a vendor security assessment",
        "description": "Records a security assessment of a vendor: the questionnaire, the responses and a score. It is completed unless another status is given, and a completed assessment's score becomes the vendor's risk score. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "questionnaire": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "responses": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "score": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "in_progress",
                      "completed",
                      "archived"
                    ]
                  }
                },
                "required": [
                  "questionnaire",
                  "responses"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Record a vendor security assessment",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "vendorId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "questionnaire": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "responses": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "score": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "in_progress",
                        "completed",
                        "archived"
                      ]
                    },
                    "reviewerId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "vendorId",
                    "questionnaire",
                    "responses",
                    "score",
                    "status",
                    "reviewerId",
                    "completedAt",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/vendors/{vendorId}/assessments/{assessmentId}": {
      "patch": {
        "operationId": "compliance.vendor_assessment_update",
        "summary": "Update a vendor security assessment",
        "description": "Replaces a vendor assessment's responses and score and stamps it completed now; its status is left as it was. A score becomes the vendor's risk score. The assessment must belong to the named vendor. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "assessmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "responses": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "score": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "responses"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a vendor security assessment",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "vendorId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "questionnaire": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "responses": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "score": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "in_progress",
                        "completed",
                        "archived"
                      ]
                    },
                    "reviewerId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "vendorId",
                    "questionnaire",
                    "responses",
                    "score",
                    "status",
                    "reviewerId",
                    "completedAt",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/vendor-assessments/{assessmentId}": {
      "delete": {
        "operationId": "compliance.vendor_assessment_delete",
        "summary": "Delete a vendor security assessment",
        "description": "Permanently deletes a vendor assessment with the evidence filed against it, auditor links to that evidence included. The vendor's risk score is left as it is. Refused while any of that evidence carries recorded approval decisions. The deletion is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "assessmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete a vendor security assessment",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assessmentId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "assessmentId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/action-plans": {
      "get": {
        "operationId": "compliance.action_plan_list",
        "summary": "List a client's action plans",
        "description": "Lists one client's remediation action plans, soonest due date first with undated plans last, optionally by status. A plan already pushed to the PSA carries its ticket link, so a caller can tell committed work from a proposal. A client in another workspace is not found.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "in_progress",
                "completed",
                "cancelled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's action plans",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "gapId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ownerId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dueDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "priority": {
                            "type": "string",
                            "enum": [
                              "critical",
                              "high",
                              "medium",
                              "low"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "open",
                              "in_progress",
                              "completed",
                              "cancelled"
                            ]
                          },
                          "cwTicketId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "cwTicketUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "cwSyncedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "createdBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ownerName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "gapId",
                          "title",
                          "description",
                          "ownerId",
                          "dueDate",
                          "priority",
                          "status",
                          "cwTicketId",
                          "cwTicketUrl",
                          "cwSyncedAt",
                          "createdAt",
                          "updatedAt",
                          "createdBy",
                          "ownerName"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/exceptions": {
      "post": {
        "operationId": "compliance.exception_create",
        "summary": "Submit a compliance exception for a gap",
        "description": "Submits a time-boxed exception for a client's compliance gap: why the gap is accepted, who approved it, and when the exception expires. It starts in submitted status. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "gapId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "justification": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000
                  },
                  "approvedBy": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "expiresAt": {
                    "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": [
                  "gapId",
                  "justification",
                  "expiresAt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submit a compliance exception for a gap",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "gapId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "justification": {
                      "type": "string"
                    },
                    "approvedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvedByUserId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "renewalReminderSentAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "needs_clarification",
                        "submitted",
                        "approved",
                        "denied",
                        "expired",
                        "revoked"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "gapId",
                    "justification",
                    "approvedBy",
                    "approvedByUserId",
                    "expiresAt",
                    "renewalReminderSentAt",
                    "status",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/exceptions/{exceptionId}/renew": {
      "post": {
        "operationId": "compliance.exception_renew",
        "summary": "Renew a compliance exception",
        "description": "Moves a compliance exception's expiry and clears its renewal reminder, optionally replacing its justification and approver. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "exceptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "expiresAt": {
                    "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)))$"
                  },
                  "justification": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "approvedBy": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "expiresAt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Renew a compliance exception",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "gapId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "justification": {
                      "type": "string"
                    },
                    "approvedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvedByUserId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "renewalReminderSentAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "needs_clarification",
                        "submitted",
                        "approved",
                        "denied",
                        "expired",
                        "revoked"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "gapId",
                    "justification",
                    "approvedBy",
                    "approvedByUserId",
                    "expiresAt",
                    "renewalReminderSentAt",
                    "status",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/exceptions/{exceptionId}/revoke": {
      "post": {
        "operationId": "compliance.exception_revoke",
        "summary": "Revoke a compliance exception",
        "description": "Revokes a compliance exception, so its gap is no longer covered by it. The exception is kept, revoked, for its history; the revocation is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "exceptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoke a compliance exception",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "gapId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "justification": {
                      "type": "string"
                    },
                    "approvedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvedByUserId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "renewalReminderSentAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "needs_clarification",
                        "submitted",
                        "approved",
                        "denied",
                        "expired",
                        "revoked"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "gapId",
                    "justification",
                    "approvedBy",
                    "approvedByUserId",
                    "expiresAt",
                    "renewalReminderSentAt",
                    "status",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/action-plans": {
      "post": {
        "operationId": "compliance.action_plan_create",
        "summary": "Create a compliance action plan",
        "description": "Creates a remediation plan for a client, optionally for one of its compliance gaps, with an owner, due date, priority and status. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "gapId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "ownerId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "dueDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date",
                        "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])))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "priority": {
                    "default": "medium",
                    "type": "string",
                    "enum": [
                      "critical",
                      "high",
                      "medium",
                      "low"
                    ]
                  },
                  "status": {
                    "default": "open",
                    "type": "string",
                    "enum": [
                      "open",
                      "in_progress",
                      "completed",
                      "cancelled"
                    ]
                  }
                },
                "required": [
                  "title"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a compliance action plan",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "gapId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ownerId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dueDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "priority": {
                      "type": "string",
                      "enum": [
                        "critical",
                        "high",
                        "medium",
                        "low"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "in_progress",
                        "completed",
                        "cancelled"
                      ]
                    },
                    "cwTicketId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cwTicketUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cwSyncedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "gapId",
                    "title",
                    "description",
                    "ownerId",
                    "dueDate",
                    "priority",
                    "status",
                    "cwTicketId",
                    "cwTicketUrl",
                    "cwSyncedAt",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/action-plans/{actionPlanId}": {
      "patch": {
        "operationId": "compliance.action_plan_update",
        "summary": "Update a compliance action plan",
        "description": "Changes a compliance action plan's title, description, owner, due date, priority or status, or records the ConnectWise ticket it was synced to; fields left out keep their value. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "actionPlanId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "ownerId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "dueDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date",
                        "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])))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "critical",
                      "high",
                      "medium",
                      "low"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "in_progress",
                      "completed",
                      "cancelled"
                    ]
                  },
                  "cwTicketId": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "cwTicketUrl": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "cwSyncedAt": {
                    "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)))$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a compliance action plan",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "gapId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ownerId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dueDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "priority": {
                      "type": "string",
                      "enum": [
                        "critical",
                        "high",
                        "medium",
                        "low"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "in_progress",
                        "completed",
                        "cancelled"
                      ]
                    },
                    "cwTicketId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cwTicketUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cwSyncedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "gapId",
                    "title",
                    "description",
                    "ownerId",
                    "dueDate",
                    "priority",
                    "status",
                    "cwTicketId",
                    "cwTicketUrl",
                    "cwSyncedAt",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "compliance.action_plan_delete",
        "summary": "Delete a compliance action plan",
        "description": "Permanently deletes a compliance action plan. A ConnectWise ticket it was synced to stays in ConnectWise; action-log entries that named the plan keep their rows with the reference cleared. The deletion is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "actionPlanId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete a compliance action plan",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "actionPlanId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "actionPlanId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/activity": {
      "post": {
        "operationId": "compliance.activity_log_record",
        "summary": "Record a compliance activity",
        "description": "Adds one entry to the workspace's compliance activity feed (a framework activated, a gap created or resolved, evidence uploaded, a control marked not applicable), optionally for a client and attributed to another person of the workspace.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "eventType": {
                    "type": "string",
                    "enum": [
                      "framework_activated",
                      "gap_created",
                      "gap_resolved",
                      "evidence_uploaded",
                      "control_marked_na"
                    ]
                  },
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "eventData": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "actorId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "eventType"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Record a compliance activity",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "eventType": {
                      "type": "string",
                      "enum": [
                        "framework_activated",
                        "gap_created",
                        "gap_resolved",
                        "evidence_uploaded",
                        "control_marked_na"
                      ]
                    },
                    "eventData": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "actorId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "eventType",
                    "eventData",
                    "actorId",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/frameworks/{frameworkId}": {
      "delete": {
        "operationId": "compliance.framework_scope_delete",
        "summary": "Remove a compliance framework from a client",
        "description": "Removes a compliance framework from a client outright, so it no longer appears in the client's scope at all. The client's evidence, gaps and history are kept. compliance.framework_deactivate turns a framework off and keeps its scope instead.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "frameworkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove a compliance framework from a client",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "frameworkId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "scopeId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "clientId",
                    "frameworkId",
                    "scopeId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/controls/{controlId}/settings": {
      "put": {
        "operationId": "compliance.control_settings_upsert",
        "summary": "Set whether a control applies to a client",
        "description": "Marks a compliance control applicable or not applicable to a client, with an optional note such as the reason it does not apply. A not-applicable control drops out of the client's compliance score. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "controlId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "isApplicable": {
                    "type": "boolean"
                  },
                  "customNotes": {
                    "type": "string",
                    "maxLength": 50000
                  }
                },
                "required": [
                  "isApplicable"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set whether a control applies to a client",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "controlId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "isApplicable": {
                      "type": "boolean"
                    },
                    "customNotes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createTicketOnGap": {
                      "type": "boolean"
                    },
                    "ticketPriority": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "low",
                            "medium",
                            "high",
                            "critical"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvalStatus": {
                      "type": "string",
                      "enum": [
                        "needs_review",
                        "reviewed",
                        "approved",
                        "rejected",
                        "changes_requested"
                      ]
                    },
                    "approvalReviewedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalReviewedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvalApprovedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalApprovedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "controlId",
                    "isApplicable",
                    "customNotes",
                    "createTicketOnGap",
                    "ticketPriority",
                    "approvalStatus",
                    "approvalReviewedAt",
                    "approvalReviewedBy",
                    "approvalApprovedAt",
                    "approvalApprovedBy",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/evidence": {
      "post": {
        "operationId": "compliance.evidence_create",
        "summary": "Record compliance evidence",
        "description": "Records a piece of compliance evidence for a client's control or for a vendor assessment: an uploaded file's location, a link with a description, or a note, with a compliance status (needs review by default) and an optional expiry. The file itself is uploaded separately. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "controlId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "vendorAssessmentId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "artifactType": {
                    "type": "string",
                    "enum": [
                      "file_upload",
                      "url_link",
                      "text_note"
                    ]
                  },
                  "artifactData": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "complianceStatus": {
                    "default": "needs_review",
                    "type": "string",
                    "enum": [
                      "compliant",
                      "non_compliant",
                      "needs_review",
                      "not_applicable"
                    ]
                  },
                  "expiresAt": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date",
                            "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])))$"
                          },
                          {
                            "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)))$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "artifactType",
                  "artifactData"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Record compliance evidence",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "controlId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "vendorAssessmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "evidenceSourceId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "artifactType": {
                      "type": "string",
                      "enum": [
                        "api_snapshot",
                        "file_upload",
                        "url_link",
                        "text_note"
                      ]
                    },
                    "artifactData": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "complianceStatus": {
                      "type": "string",
                      "enum": [
                        "compliant",
                        "non_compliant",
                        "needs_review",
                        "not_applicable"
                      ]
                    },
                    "approvalStatus": {
                      "type": "string",
                      "enum": [
                        "needs_review",
                        "reviewed",
                        "approved",
                        "rejected",
                        "changes_requested"
                      ]
                    },
                    "approvalReviewedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalReviewedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvalApprovedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalApprovedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "collectedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "evidenceSource": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "sourceType": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isAutomated": {
                          "type": "boolean"
                        },
                        "integrationTable": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "sourceType",
                        "displayName",
                        "description",
                        "isAutomated",
                        "integrationTable",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "controlId",
                    "vendorAssessmentId",
                    "evidenceSourceId",
                    "artifactType",
                    "artifactData",
                    "complianceStatus",
                    "approvalStatus",
                    "approvalReviewedAt",
                    "approvalReviewedBy",
                    "approvalApprovedAt",
                    "approvalApprovedBy",
                    "collectedAt",
                    "expiresAt",
                    "createdAt",
                    "updatedAt",
                    "evidenceSource"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/evidence/{artifactId}": {
      "delete": {
        "operationId": "compliance.evidence_delete",
        "summary": "Delete compliance evidence",
        "description": "Permanently deletes an evidence artifact and every auditor share link to it, so a link an auditor holds stops working. An uploaded file is not removed from storage by this call. Evidence with recorded approval decisions cannot be deleted. The deletion is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete compliance evidence",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "artifactId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "required": [
                    "artifactId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/evidence/{artifactId}/link": {
      "post": {
        "operationId": "compliance.evidence_link",
        "summary": "Link compliance evidence to more controls",
        "description": "Copies an evidence artifact onto further controls of the same client, so one file, link or note counts as evidence for each. Each copy is its own artifact; the original is unchanged. The links are written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "targetControlIds": {
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  }
                },
                "required": [
                  "targetControlIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Link compliance evidence to more controls",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "artifactIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      }
                    }
                  },
                  "required": [
                    "artifactIds"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/evidence/{artifactId}/auditor-shares": {
      "get": {
        "operationId": "compliance.evidence_share_list",
        "summary": "List an evidence artifact's auditor share links",
        "description": "Lists the auditor share links made for an evidence artifact, newest first, revoked and expired ones included, with how often each was opened. Tokens are never returned. Paged with an opaque cursor.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List an evidence artifact's auditor share links",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "artifactId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "tokenPrefix": {
                            "type": "string"
                          },
                          "auditorLabel": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "expiresAt": {
                            "type": "string"
                          },
                          "revokedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "createdBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastAccessedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "accessCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "artifactId",
                          "clientId",
                          "tokenPrefix",
                          "auditorLabel",
                          "expiresAt",
                          "revokedAt",
                          "createdAt",
                          "createdBy",
                          "lastAccessedAt",
                          "accessCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "compliance.evidence_share_create",
        "summary": "Create an auditor share link for evidence",
        "description": "Creates an expiring link that lets an outside auditor open one evidence artifact without signing in, valid for up to ninety days. The answer carries the link's token once and it cannot be shown again. Anyone holding the link can access the evidence until the link expires or is revoked.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "expiresAt": {
                    "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)))$"
                  },
                  "auditorLabel": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "expiresAt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create an auditor share link for evidence",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "artifactId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "tokenPrefix": {
                      "type": "string"
                    },
                    "auditorLabel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "revokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastAccessedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "accessCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "token": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "artifactId",
                    "clientId",
                    "tokenPrefix",
                    "auditorLabel",
                    "expiresAt",
                    "revokedAt",
                    "createdAt",
                    "createdBy",
                    "lastAccessedAt",
                    "accessCount",
                    "token"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/auditor-shares/{shareId}/revoke": {
      "post": {
        "operationId": "compliance.evidence_share_revoke",
        "summary": "Revoke an auditor share link",
        "description": "Revokes an auditor share link at once, so the auditor holding it can no longer open the evidence. A revoked link cannot be restored.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "shareId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoke an auditor share link",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "artifactId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "tokenPrefix": {
                      "type": "string"
                    },
                    "auditorLabel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "revokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastAccessedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "accessCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "artifactId",
                    "clientId",
                    "tokenPrefix",
                    "auditorLabel",
                    "expiresAt",
                    "revokedAt",
                    "createdAt",
                    "createdBy",
                    "lastAccessedAt",
                    "accessCount"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/evidence/{artifactId}/expiry": {
      "put": {
        "operationId": "compliance.evidence_expiry_update",
        "summary": "Change when compliance evidence expires",
        "description": "Sets or clears an evidence artifact's expiry; expired evidence stops counting toward the control. The change is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "expiresAt": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date",
                            "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])))$"
                          },
                          {
                            "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)))$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "expiresAt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Change when compliance evidence expires",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "controlId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "vendorAssessmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "evidenceSourceId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "artifactType": {
                      "type": "string",
                      "enum": [
                        "api_snapshot",
                        "file_upload",
                        "url_link",
                        "text_note"
                      ]
                    },
                    "artifactData": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "complianceStatus": {
                      "type": "string",
                      "enum": [
                        "compliant",
                        "non_compliant",
                        "needs_review",
                        "not_applicable"
                      ]
                    },
                    "approvalStatus": {
                      "type": "string",
                      "enum": [
                        "needs_review",
                        "reviewed",
                        "approved",
                        "rejected",
                        "changes_requested"
                      ]
                    },
                    "approvalReviewedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalReviewedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvalApprovedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvalApprovedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "collectedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "evidenceSource": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "sourceType": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isAutomated": {
                          "type": "boolean"
                        },
                        "integrationTable": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "sourceType",
                        "displayName",
                        "description",
                        "isAutomated",
                        "integrationTable",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "controlId",
                    "vendorAssessmentId",
                    "evidenceSourceId",
                    "artifactType",
                    "artifactData",
                    "complianceStatus",
                    "approvalStatus",
                    "approvalReviewedAt",
                    "approvalReviewedBy",
                    "approvalApprovedAt",
                    "approvalApprovedBy",
                    "collectedAt",
                    "expiresAt",
                    "createdAt",
                    "updatedAt",
                    "evidenceSource"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/drift-alerts/{alertId}/acknowledge": {
      "post": {
        "operationId": "compliance.drift_alert_acknowledge",
        "summary": "Acknowledge a compliance drift alert",
        "description": "Marks a compliance drift alert acknowledged now. Acknowledging it again moves the time forward. The acknowledgement is written to the client's compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "alertId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledge a compliance drift alert",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "alertId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "clientId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "acknowledgedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "alertId",
                    "clientId",
                    "acknowledgedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/compliance/frameworks/{frameworkId}/complete-activation": {
      "post": {
        "operationId": "compliance.framework_activation_complete",
        "summary": "Activate a framework for a client from its control settings",
        "description": "Brings a client into scope for a compliance framework, as the compliance wizard does: controls marked not applicable are recorded with their reason, and each applicable control the client has no evidence for gets an open gap whose action follows the workspace's defaults. A framework the client already has answers a conflict.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "frameworkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "controlSettings": {
                    "maxItems": 5000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "controlId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "applicable": {
                          "type": "boolean"
                        },
                        "naReason": {
                          "type": "string",
                          "maxLength": 50000
                        }
                      },
                      "required": [
                        "controlId",
                        "applicable"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 50000
                  }
                },
                "required": [
                  "controlSettings"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Activate a framework for a client from its control settings",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scopeId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "gapsCreated": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "scopeId",
                    "gapsCreated"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/gap-action-mappings": {
      "put": {
        "operationId": "compliance.gap_action_mapping_set",
        "summary": "Set how new compliance gaps are handled",
        "description": "Sets the action a new compliance gap gets (ticket, quote, flagged or no action): the workspace default when no framework is named, a framework's default when one is, or one control's action when a framework and control are. The most specific setting wins.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "defaultAction": {
                    "type": "string",
                    "enum": [
                      "ticket",
                      "quote",
                      "flagged",
                      "no_action"
                    ]
                  },
                  "frameworkId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "controlId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "defaultAction"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set how new compliance gaps are handled",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "frameworkId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "controlId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "defaultAction": {
                      "type": "string",
                      "enum": [
                        "ticket",
                        "quote",
                        "flagged",
                        "no_action"
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "frameworkId",
                    "controlId",
                    "defaultAction",
                    "createdAt",
                    "updatedAt",
                    "createdBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/gap-action-mappings/remove": {
      "post": {
        "operationId": "compliance.gap_action_mapping_remove",
        "summary": "Remove a framework or control gap-action setting",
        "description": "Removes a framework's default gap action, or one control's own action, so new gaps fall back to the next level up. The workspace default cannot be removed, only changed.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "frameworkId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "controlId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "frameworkId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove a framework or control gap-action setting",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "removed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/ticket-rules/{controlId}": {
      "put": {
        "operationId": "compliance.ticket_rule_upsert",
        "summary": "Set whether a control's gaps open tickets",
        "description": "Sets, for the whole workspace, whether a compliance gap on a control opens a PSA ticket and at what priority. The change is written to the compliance action log.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "controlId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "createTicketOnGap": {
                    "type": "boolean"
                  },
                  "ticketPriority": {
                    "default": "medium",
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high",
                      "critical"
                    ]
                  }
                },
                "required": [
                  "createTicketOnGap"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set whether a control's gaps open tickets",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "controlId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "createTicketOnGap": {
                      "type": "boolean"
                    },
                    "ticketPriority": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "low",
                            "medium",
                            "high",
                            "critical"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "controlId",
                    "createTicketOnGap",
                    "ticketPriority",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/ticket-rules": {
      "put": {
        "operationId": "compliance.ticket_rule_bulk_upsert",
        "summary": "Set whether many controls' gaps open tickets",
        "description": "Sets one ticket rule on up to a thousand controls at once, as the GRC settings page does for an implementation group, writing an action-log entry per control.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "controlIds": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    }
                  },
                  "createTicketOnGap": {
                    "type": "boolean"
                  },
                  "ticketPriority": {
                    "default": "medium",
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high",
                      "critical"
                    ]
                  }
                },
                "required": [
                  "controlIds",
                  "createTicketOnGap"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set whether many controls' gaps open tickets",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "controlId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "createTicketOnGap": {
                            "type": "boolean"
                          },
                          "ticketPriority": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "low",
                                  "medium",
                                  "high",
                                  "critical"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "controlId",
                          "createTicketOnGap",
                          "ticketPriority",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/approval-events": {
      "get": {
        "operationId": "compliance.approval_event_list",
        "summary": "List compliance approval decisions",
        "description": "Lists the recorded review and approval decisions on compliance gaps, controls and evidence, newest first, optionally narrowed to a client, a target, or the gap, control or evidence they concern. Each names who decided and their attestation. Paged with an opaque cursor.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "targetType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "gap",
                "control",
                "evidence"
              ]
            }
          },
          {
            "name": "targetId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "gapId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "controlId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "artifactId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List compliance approval decisions",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "targetType": {
                            "type": "string",
                            "enum": [
                              "gap",
                              "control",
                              "evidence"
                            ]
                          },
                          "targetId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "gapId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "controlId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "artifactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "priorStatus": {
                            "type": "string",
                            "enum": [
                              "needs_review",
                              "reviewed",
                              "approved",
                              "rejected",
                              "changes_requested"
                            ]
                          },
                          "newStatus": {
                            "type": "string",
                            "enum": [
                              "needs_review",
                              "reviewed",
                              "approved",
                              "rejected",
                              "changes_requested"
                            ]
                          },
                          "decision": {
                            "type": "string"
                          },
                          "attestation": {
                            "type": "string"
                          },
                          "actorId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "actorName": {
                            "type": "string"
                          },
                          "eventPayload": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "targetType",
                          "targetId",
                          "gapId",
                          "controlId",
                          "artifactId",
                          "priorStatus",
                          "newStatus",
                          "decision",
                          "attestation",
                          "actorId",
                          "actorName",
                          "eventPayload",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/approvals": {
      "post": {
        "operationId": "compliance.approval_transition_record",
        "summary": "Record an approval decision on a compliance item",
        "description": "Moves a compliance gap, a client's control or an evidence item to a new review status (reviewed, approved, rejected, changes requested or back to needs review) with the reviewer's attestation, under the allowed transitions, and records the decision in the approval history and the compliance action log. A transition the current status does not allow answers a conflict.",
        "tags": [
          "compliance"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "targetType": {
                    "type": "string",
                    "enum": [
                      "gap",
                      "control",
                      "evidence"
                    ]
                  },
                  "targetId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "approvalStatus": {
                    "type": "string",
                    "enum": [
                      "needs_review",
                      "reviewed",
                      "approved",
                      "rejected",
                      "changes_requested"
                    ]
                  },
                  "attestation": {
                    "type": "string",
                    "maxLength": 50000
                  },
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "eventData": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "targetType",
                  "targetId",
                  "approvalStatus",
                  "attestation"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Record an approval decision on a compliance item",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "eventId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "priorStatus": {
                      "type": "string",
                      "enum": [
                        "needs_review",
                        "reviewed",
                        "approved",
                        "rejected",
                        "changes_requested"
                      ]
                    },
                    "approvalStatus": {
                      "type": "string",
                      "enum": [
                        "needs_review",
                        "reviewed",
                        "approved",
                        "rejected",
                        "changes_requested"
                      ]
                    }
                  },
                  "required": [
                    "eventId",
                    "priorStatus",
                    "approvalStatus"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qbr-client-summaries": {
      "get": {
        "operationId": "assessment.client_qbr_summary_list",
        "summary": "List each client's QBR status",
        "description": "Lists one row per client whose source has not removed it, ordered by client id: its endpoint count, its latest QBR assessment and when the one before it ran, and how that QBR went out (an interactive link or a Gamma deck) with whether it is a draft, sent, or viewed by the client. Paged with an opaque cursor.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List each client's QBR status",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientName": {
                            "type": "string"
                          },
                          "industry": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "endpointCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "latestAssessmentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dateGenerated": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastReview": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "format": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "deck",
                                  "interactive"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "draft",
                                  "sent",
                                  "viewed"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "latestPublicationId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "latestPublicationStatus": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "draft",
                                  "published",
                                  "revoked"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "latestDeckJobId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "latestDeckJobStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "latestDeckShareId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "latestDeckShareStatus": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "draft",
                                  "published",
                                  "revoked"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "clientId",
                          "clientName",
                          "industry",
                          "endpointCount",
                          "latestAssessmentId",
                          "dateGenerated",
                          "lastReview",
                          "format",
                          "status",
                          "latestPublicationId",
                          "latestPublicationStatus",
                          "latestDeckJobId",
                          "latestDeckJobStatus",
                          "latestDeckShareId",
                          "latestDeckShareStatus"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/qbr-history": {
      "get": {
        "operationId": "assessment.client_qbr_history",
        "summary": "List a client's QBR history",
        "description": "Lists a client's QBRs newest first, including working documents and QBR assessments, each with its title, status, delivery type and reporting period. Paged with an opaque cursor.",
        "tags": [
          "assessment"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's QBR history",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "title": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "deliveryType": {
                            "type": "string"
                          },
                          "reportingPeriodStart": {
                            "type": "string"
                          },
                          "reportingPeriodEnd": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "working",
                              "legacy"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "status",
                          "deliveryType",
                          "reportingPeriodStart",
                          "reportingPeriodEnd",
                          "createdAt",
                          "source"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/opportunities/{opportunityId}/notes": {
      "get": {
        "operationId": "opportunity_note.list",
        "summary": "List an opportunity's notes",
        "description": "Lists the notes logged on an opportunity in the caller's tenant, most recent first, capped at limit (default 50, max 200), each with its author and assignee's names. An opportunity id in another tenant answers an empty list rather than not_found, so the answer never reveals whether the id exists elsewhere.",
        "tags": [
          "opportunity_note"
        ],
        "parameters": [
          {
            "name": "opportunityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List an opportunity's notes",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "opportunityId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "content": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "activityDate": {
                            "type": "string"
                          },
                          "assignedTo": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "mentions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "userId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "displayName": {
                                  "type": "string"
                                },
                                "email": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "userId",
                                "displayName"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "assignedUser": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "firstName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "lastName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "firstName",
                                  "lastName",
                                  "email"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdByUser": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "firstName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "lastName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "email": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "firstName",
                                  "lastName",
                                  "email"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "opportunityId",
                          "subject",
                          "content",
                          "activityDate",
                          "assignedTo",
                          "createdBy",
                          "createdAt",
                          "updatedAt",
                          "mentions",
                          "assignedUser",
                          "createdByUser"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "notes"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "opportunity_note.create",
        "summary": "Add a note to an opportunity",
        "description": "Logs a note on an opportunity in the caller's tenant and best-effort notifies every mentioned user. An opportunity id outside the tenant answers not_found. A mention notification that cannot be recorded does not fail the note create; its error is returned in notificationErrors.",
        "tags": [
          "opportunity_note"
        ],
        "parameters": [
          {
            "name": "opportunityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "subject": {
                    "type": "string",
                    "minLength": 1
                  },
                  "content": {
                    "type": "string",
                    "minLength": 1
                  },
                  "mentions": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "userId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "userId",
                        "displayName"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "subject",
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add a note to an opportunity",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "note": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "opportunityId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "subject": {
                          "type": "string"
                        },
                        "content": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "activityDate": {
                          "type": "string"
                        },
                        "assignedTo": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdBy": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "mentions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "userId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              "displayName": {
                                "type": "string"
                              },
                              "email": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "userId",
                              "displayName"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "assignedUser": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "firstName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "lastName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "email": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "firstName",
                                "lastName",
                                "email"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdByUser": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "firstName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "lastName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "email": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "firstName",
                                "lastName",
                                "email"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "opportunityId",
                        "subject",
                        "content",
                        "activityDate",
                        "assignedTo",
                        "createdBy",
                        "createdAt",
                        "updatedAt",
                        "mentions",
                        "assignedUser",
                        "createdByUser"
                      ],
                      "additionalProperties": false
                    },
                    "notificationFailures": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "notificationErrors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "note",
                    "notificationFailures",
                    "notificationErrors"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clients/{clientId}/configurations": {
      "get": {
        "operationId": "configuration.list",
        "summary": "List a client's configurations",
        "description": "Lists one client's configurations (devices and assets) in the caller's tenant with their hardware, backup and RMM posture fields, type and location names, active source badges, derived health, and the device each may duplicate. Ordered by name with the id as tiebreaker and paged with an opaque cursor. A client outside the tenant or hidden answers not_found. PSA mirror ids, MAC address, last login, custom fields and warranty dates are null for an API key.",
        "tags": [
          "configuration"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a client's configurations",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "tenantId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "clientName": {
                            "type": "string"
                          },
                          "configurationName": {
                            "type": "string"
                          },
                          "configurationType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "configurationTypeId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lifecycleStatus": {
                            "type": "string"
                          },
                          "sourcePresence": {
                            "type": "string"
                          },
                          "identityUnverified": {
                            "type": "boolean"
                          },
                          "possibleDuplicateOf": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "manufacturer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "modelNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "serialNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tagNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "deviceIdentifier": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ipAddress": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "defaultGateway": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "macAddress": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "osType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "osInfo": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "cpuInfo": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ramGb": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "ramRaw": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "storageGb": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "localHardDrivesRaw": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "notes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendorNotes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "installationDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "purchaseDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "warrantyExpirationDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastLoginName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "contactId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "contactName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "siteId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "siteName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "systemLocationId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "systemDepartmentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "backupSuccesses": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "backupIncomplete": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "backupFailed": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "backupRestoreSuccesses": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "backupRestoreFailed": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "remoteAgentInstalled": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "billFlag": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "cwActiveFlag": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "online": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "lastSeenAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "patchStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastPatchCheckAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pendingPatchCount": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "antivirusStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "antivirusLastUpdateAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "edrStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "diskEncryptionStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "monitoringAgentStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "activeAlertCount": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastRmmPostureSyncAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectwiseConfigurationId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "cwContactId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "cwSiteId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "connectwiseLocationId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "connectwiseDepartmentId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "haloAssetId": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "itglueConfigurationId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectwiseSyncStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "haloSyncStatus": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastSyncedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "externalUpdatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "orphanedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastSeenPsaSyncJobId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "customFields": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "configurationTypeName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "systemLocationName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sourceBadges": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "source": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "presence": {
                                  "type": "string"
                                },
                                "online": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "lastSeenAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "sourceSyncedAt": {
                                  "type": "string"
                                },
                                "agentVersion": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "source",
                                "label",
                                "presence",
                                "online",
                                "lastSeenAt",
                                "sourceSyncedAt",
                                "agentVersion"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "sourceFacets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "source": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "presence": {
                                  "type": "string"
                                },
                                "online": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "lastSeenAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "sourceSyncedAt": {
                                  "type": "string"
                                },
                                "agentVersion": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "sourceExternalId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "loggedInUser": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "source",
                                "label",
                                "presence",
                                "online",
                                "lastSeenAt",
                                "sourceSyncedAt",
                                "agentVersion",
                                "sourceExternalId",
                                "loggedInUser"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "sourceCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "duplicateTarget": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "status": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "lifecycleStatus": {
                                    "type": "string"
                                  },
                                  "serialNumber": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "modelNumber": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "lastSeenAt": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "healthLastSeenAt": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "sourceBadges": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "source": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "presence": {
                                          "type": "string"
                                        },
                                        "online": {
                                          "type": [
                                            "boolean",
                                            "null"
                                          ]
                                        },
                                        "lastSeenAt": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "sourceSyncedAt": {
                                          "type": "string"
                                        },
                                        "agentVersion": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "source",
                                        "label",
                                        "presence",
                                        "online",
                                        "lastSeenAt",
                                        "sourceSyncedAt",
                                        "agentVersion"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "sourceFacets": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "source": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "presence": {
                                          "type": "string"
                                        },
                                        "online": {
                                          "type": [
                                            "boolean",
                                            "null"
                                          ]
                                        },
                                        "lastSeenAt": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "sourceSyncedAt": {
                                          "type": "string"
                                        },
                                        "agentVersion": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "sourceExternalId": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "loggedInUser": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "source",
                                        "label",
                                        "presence",
                                        "online",
                                        "lastSeenAt",
                                        "sourceSyncedAt",
                                        "agentVersion",
                                        "sourceExternalId",
                                        "loggedInUser"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "type",
                                  "status",
                                  "lifecycleStatus",
                                  "serialNumber",
                                  "modelNumber",
                                  "lastSeenAt",
                                  "healthLastSeenAt",
                                  "sourceBadges",
                                  "sourceFacets"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "healthOnline": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "healthLastSeenAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "healthAgentVersion": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "tenantId",
                          "clientId",
                          "clientName",
                          "configurationName",
                          "configurationType",
                          "configurationTypeId",
                          "description",
                          "status",
                          "lifecycleStatus",
                          "sourcePresence",
                          "identityUnverified",
                          "possibleDuplicateOf",
                          "manufacturer",
                          "vendor",
                          "modelNumber",
                          "serialNumber",
                          "tagNumber",
                          "deviceIdentifier",
                          "ipAddress",
                          "defaultGateway",
                          "macAddress",
                          "osType",
                          "osInfo",
                          "cpuInfo",
                          "ramGb",
                          "ramRaw",
                          "storageGb",
                          "localHardDrivesRaw",
                          "notes",
                          "vendorNotes",
                          "installationDate",
                          "purchaseDate",
                          "warrantyExpirationDate",
                          "lastLoginName",
                          "contactId",
                          "contactName",
                          "siteId",
                          "siteName",
                          "systemLocationId",
                          "systemDepartmentId",
                          "backupSuccesses",
                          "backupIncomplete",
                          "backupFailed",
                          "backupRestoreSuccesses",
                          "backupRestoreFailed",
                          "remoteAgentInstalled",
                          "billFlag",
                          "cwActiveFlag",
                          "online",
                          "lastSeenAt",
                          "patchStatus",
                          "lastPatchCheckAt",
                          "pendingPatchCount",
                          "antivirusStatus",
                          "antivirusLastUpdateAt",
                          "edrStatus",
                          "diskEncryptionStatus",
                          "monitoringAgentStatus",
                          "activeAlertCount",
                          "lastRmmPostureSyncAt",
                          "connectwiseConfigurationId",
                          "cwContactId",
                          "cwSiteId",
                          "connectwiseLocationId",
                          "connectwiseDepartmentId",
                          "haloAssetId",
                          "itglueConfigurationId",
                          "connectwiseSyncStatus",
                          "haloSyncStatus",
                          "lastSyncedAt",
                          "externalUpdatedAt",
                          "orphanedAt",
                          "lastSeenPsaSyncJobId",
                          "customFields",
                          "createdAt",
                          "updatedAt",
                          "configurationTypeName",
                          "systemLocationName",
                          "sourceBadges",
                          "sourceFacets",
                          "sourceCount",
                          "duplicateTarget",
                          "healthOnline",
                          "healthLastSeenAt",
                          "healthAgentVersion"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[A-Za-z0-9_-]+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/configurations/{configurationId}": {
      "get": {
        "operationId": "configuration.get",
        "summary": "Get a configuration",
        "description": "Reads one configuration (device or asset) in the caller's tenant with its hardware, backup and RMM posture fields, type and location names, active source badges and facets, derived health, the device it may duplicate, and the installed software its sources reported (the first 500 by name, with the full count). A configuration in another tenant, under a hidden client, or that every linked source reports removed answers not_found. PSA mirror ids, MAC address, last login, custom fields and warranty dates are null for an API key. Configurations are read-only through the API.",
        "tags": [
          "configuration"
        ],
        "parameters": [
          {
            "name": "configurationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a configuration",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "configuration": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "tenantId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "clientName": {
                          "type": "string"
                        },
                        "configurationName": {
                          "type": "string"
                        },
                        "configurationType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "configurationTypeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lifecycleStatus": {
                          "type": "string"
                        },
                        "sourcePresence": {
                          "type": "string"
                        },
                        "identityUnverified": {
                          "type": "boolean"
                        },
                        "possibleDuplicateOf": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "manufacturer": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "vendor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "modelNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "serialNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "tagNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "deviceIdentifier": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ipAddress": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "defaultGateway": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "macAddress": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "osType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "osInfo": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cpuInfo": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ramGb": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "ramRaw": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "storageGb": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "localHardDrivesRaw": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "notes": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "vendorNotes": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "installationDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "purchaseDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warrantyExpirationDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "lastLoginName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "contactId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "contactName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "siteName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "systemLocationId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "systemDepartmentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "backupSuccesses": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "backupIncomplete": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "backupFailed": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "backupRestoreSuccesses": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "backupRestoreFailed": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "remoteAgentInstalled": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "billFlag": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "cwActiveFlag": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "online": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "lastSeenAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "patchStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastPatchCheckAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "pendingPatchCount": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "antivirusStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "antivirusLastUpdateAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "edrStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "diskEncryptionStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "monitoringAgentStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "activeAlertCount": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "lastRmmPostureSyncAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connectwiseConfigurationId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cwContactId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cwSiteId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseLocationId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "connectwiseDepartmentId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "haloAssetId": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "itglueConfigurationId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connectwiseSyncStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "haloSyncStatus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastSyncedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "externalUpdatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "orphanedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastSeenPsaSyncJobId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "customFields": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "configurationTypeName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "systemLocationName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "sourceBadges": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "source": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "presence": {
                                "type": "string"
                              },
                              "online": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "lastSeenAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sourceSyncedAt": {
                                "type": "string"
                              },
                              "agentVersion": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "source",
                              "label",
                              "presence",
                              "online",
                              "lastSeenAt",
                              "sourceSyncedAt",
                              "agentVersion"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "sourceFacets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "source": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "presence": {
                                "type": "string"
                              },
                              "online": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "lastSeenAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sourceSyncedAt": {
                                "type": "string"
                              },
                              "agentVersion": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sourceExternalId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "loggedInUser": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "source",
                              "label",
                              "presence",
                              "online",
                              "lastSeenAt",
                              "sourceSyncedAt",
                              "agentVersion",
                              "sourceExternalId",
                              "loggedInUser"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "sourceCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "duplicateTarget": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "status": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "lifecycleStatus": {
                                  "type": "string"
                                },
                                "serialNumber": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "modelNumber": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "lastSeenAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "healthLastSeenAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "sourceBadges": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "source": {
                                        "type": "string"
                                      },
                                      "label": {
                                        "type": "string"
                                      },
                                      "presence": {
                                        "type": "string"
                                      },
                                      "online": {
                                        "type": [
                                          "boolean",
                                          "null"
                                        ]
                                      },
                                      "lastSeenAt": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "sourceSyncedAt": {
                                        "type": "string"
                                      },
                                      "agentVersion": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "source",
                                      "label",
                                      "presence",
                                      "online",
                                      "lastSeenAt",
                                      "sourceSyncedAt",
                                      "agentVersion"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "sourceFacets": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "source": {
                                        "type": "string"
                                      },
                                      "label": {
                                        "type": "string"
                                      },
                                      "presence": {
                                        "type": "string"
                                      },
                                      "online": {
                                        "type": [
                                          "boolean",
                                          "null"
                                        ]
                                      },
                                      "lastSeenAt": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "sourceSyncedAt": {
                                        "type": "string"
                                      },
                                      "agentVersion": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "sourceExternalId": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "loggedInUser": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "source",
                                      "label",
                                      "presence",
                                      "online",
                                      "lastSeenAt",
                                      "sourceSyncedAt",
                                      "agentVersion",
                                      "sourceExternalId",
                                      "loggedInUser"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "type",
                                "status",
                                "lifecycleStatus",
                                "serialNumber",
                                "modelNumber",
                                "lastSeenAt",
                                "healthLastSeenAt",
                                "sourceBadges",
                                "sourceFacets"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "healthOnline": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "healthLastSeenAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "healthAgentVersion": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "tenantId",
                        "clientId",
                        "clientName",
                        "configurationName",
                        "configurationType",
                        "configurationTypeId",
                        "description",
                        "status",
                        "lifecycleStatus",
                        "sourcePresence",
                        "identityUnverified",
                        "possibleDuplicateOf",
                        "manufacturer",
                        "vendor",
                        "modelNumber",
                        "serialNumber",
                        "tagNumber",
                        "deviceIdentifier",
                        "ipAddress",
                        "defaultGateway",
                        "macAddress",
                        "osType",
                        "osInfo",
                        "cpuInfo",
                        "ramGb",
                        "ramRaw",
                        "storageGb",
                        "localHardDrivesRaw",
                        "notes",
                        "vendorNotes",
                        "installationDate",
                        "purchaseDate",
                        "warrantyExpirationDate",
                        "lastLoginName",
                        "contactId",
                        "contactName",
                        "siteId",
                        "siteName",
                        "systemLocationId",
                        "systemDepartmentId",
                        "backupSuccesses",
                        "backupIncomplete",
                        "backupFailed",
                        "backupRestoreSuccesses",
                        "backupRestoreFailed",
                        "remoteAgentInstalled",
                        "billFlag",
                        "cwActiveFlag",
                        "online",
                        "lastSeenAt",
                        "patchStatus",
                        "lastPatchCheckAt",
                        "pendingPatchCount",
                        "antivirusStatus",
                        "antivirusLastUpdateAt",
                        "edrStatus",
                        "diskEncryptionStatus",
                        "monitoringAgentStatus",
                        "activeAlertCount",
                        "lastRmmPostureSyncAt",
                        "connectwiseConfigurationId",
                        "cwContactId",
                        "cwSiteId",
                        "connectwiseLocationId",
                        "connectwiseDepartmentId",
                        "haloAssetId",
                        "itglueConfigurationId",
                        "connectwiseSyncStatus",
                        "haloSyncStatus",
                        "lastSyncedAt",
                        "externalUpdatedAt",
                        "orphanedAt",
                        "lastSeenPsaSyncJobId",
                        "customFields",
                        "createdAt",
                        "updatedAt",
                        "configurationTypeName",
                        "systemLocationName",
                        "sourceBadges",
                        "sourceFacets",
                        "sourceCount",
                        "duplicateTarget",
                        "healthOnline",
                        "healthLastSeenAt",
                        "healthAgentVersion"
                      ],
                      "additionalProperties": false
                    },
                    "software": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "version": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "publisher": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": "string"
                          },
                          "lastSeenAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "version",
                          "publisher",
                          "source",
                          "lastSeenAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "softwareTotal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "configuration",
                    "software",
                    "softwareTotal"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/configurations/{duplicateConfigurationId}/merge": {
      "post": {
        "operationId": "configuration.duplicate_merge",
        "summary": "Merge a duplicate configuration into the one it duplicates",
        "description": "Resolves a device flagged as a possible duplicate: moves every source link of the duplicate onto the target, recomputes the target's fields from its sources, and decommissions the duplicate. A client or configuration outside the tenant, or a configuration that is not this client's, answers not_found. A duplicate that is not flagged, or not flagged against this target, answers conflict.",
        "tags": [
          "configuration"
        ],
        "parameters": [
          {
            "name": "duplicateConfigurationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Opaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "targetConfigurationId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [
                  "clientId",
                  "targetConfigurationId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Merge a duplicate configuration into the one it duplicates",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "duplicateConfigurationId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "targetConfigurationId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "movedSourceCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "duplicateConfigurationId",
                    "targetConfigurationId",
                    "movedSourceCount"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalRequiredError"
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/source-facets": {
      "get": {
        "operationId": "source_facet.lookup",
        "summary": "Look up which sources claim CRM records",
        "description": "For up to 100 records of one CRM entity (client, contact, site, configuration, opportunity or agreement) in the caller's tenant, lists the distinct source types (for example connectwise_manage, halo, manual) that actively claim each. Every requested id is answered; one with no active source has an empty list.",
        "tags": [
          "source_facet"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "client",
                "contact",
                "site",
                "configuration",
                "opportunity",
                "agreement"
              ]
            }
          },
          {
            "name": "recordIds",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Look up which sources claim CRM records",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "recordId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "sourceTypes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "recordId",
                          "sourceTypes"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "records"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/psa-write-back/state": {
      "get": {
        "operationId": "psa_write_back.state",
        "summary": "Get a CRM record's ConnectWise write-back state",
        "description": "For one client, contact or site in the caller's tenant, lists each field with an unfinished or failed ConnectWise update: the value Scopable sent, the command's status and ConnectWise's error, whether the update still holds the field's barrier, and whether it may still apply. A record outside the tenant answers not_found.",
        "tags": [
          "psa_write_back"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "clients",
                "contacts",
                "sites"
              ]
            }
          },
          {
            "name": "recordId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a CRM record's ConnectWise write-back state",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fields": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "column": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "expected": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "detail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "barrierHeld": {
                            "type": "boolean"
                          },
                          "inFlight": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "field",
                          "column",
                          "expected",
                          "status",
                          "detail",
                          "barrierHeld",
                          "inFlight"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "fields"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/psa-write-back/state-batch": {
      "get": {
        "operationId": "psa_write_back.state_batch",
        "summary": "Get several CRM records' ConnectWise write-back state",
        "description": "For up to 100 clients, contacts or sites in the caller's tenant, lists each record's fields with an unfinished or failed ConnectWise update, as psa_write_back.state does for one. Every requested id is answered; one with nothing open has no fields.",
        "tags": [
          "psa_write_back"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "clients",
                "contacts",
                "sites"
              ]
            }
          },
          {
            "name": "recordIds",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get several CRM records' ConnectWise write-back state",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "recordId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "column": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "expected": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "status": {
                                  "type": "string"
                                },
                                "detail": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "barrierHeld": {
                                  "type": "boolean"
                                },
                                "inFlight": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "field",
                                "column",
                                "expected",
                                "status",
                                "detail",
                                "barrierHeld",
                                "inFlight"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "recordId",
                          "fields"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "records"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/connectwise/inventory-counts": {
      "get": {
        "operationId": "connectwise.inventory_counts",
        "summary": "Count the records ConnectWise currently backs",
        "description": "Counts, for the caller's tenant, the companies, contacts, configurations, opportunities, agreements and catalog products ConnectWise currently backs. A count that could not be taken is null and named in failures; the rest still answer.",
        "tags": [
          "connectwise"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Count the records ConnectWise currently backs",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "counts": {
                      "type": "object",
                      "properties": {
                        "companies": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "contacts": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "configurations": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "opportunities": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agreements": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "productCatalog": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "companies",
                        "contacts",
                        "configurations",
                        "opportunities",
                        "agreements",
                        "productCatalog"
                      ],
                      "additionalProperties": false
                    },
                    "failures": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "companies",
                          "contacts",
                          "configurations",
                          "opportunities",
                          "agreements",
                          "product_catalog"
                        ]
                      }
                    }
                  },
                  "required": [
                    "counts",
                    "failures"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationFailedError"
                }
              }
            }
          },
          "401": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "429": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedError"
                }
              }
            }
          },
          "503": {
            "description": "Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnavailableError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A Scopable API key, sent as `Authorization: Bearer sk_live_...` (or `sk_test_...`). A workspace administrator creates keys under Settings, Developer. Each key belongs to one workspace and holds `<domain>:read` or `<domain>:write` scopes."
      }
    },
    "headers": {
      "RateLimit-Limit": {
        "description": "The call allowance of the quota window closest to being used up, per minute.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "RateLimit-Remaining": {
        "description": "Calls left in that window before requests are refused.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "RateLimit-Reset": {
        "description": "Whole seconds until that window rolls over.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "RateLimit-Policy": {
        "description": "The quota that window enforces, as `<limit>;w=<window seconds>`, for example `600;w=60`.",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]+;w=[0-9]+$"
        }
      },
      "Retry-After": {
        "description": "Whole seconds to wait before repeating a refused call. Sent with 429 responses.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "schemas": {
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "validation_failed",
                  "unauthorized",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "approval_required",
                  "rate_limited",
                  "unavailable"
                ]
              },
              "type": {
                "type": "string",
                "format": "uri",
                "description": "Identifies the kind of error, one per `code`. It resolves to the schema in this document that describes that code."
              },
              "message": {
                "type": "string",
                "minLength": 1
              },
              "requestId": {
                "type": "string",
                "minLength": 1
              },
              "details": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              }
            },
            "required": [
              "code",
              "type",
              "message",
              "requestId"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "ValidationFailedError": {
        "title": "Validation failed",
        "description": "The request does not match the operation's schema, a cursor is not valid for this operation and filter set, or a required header is missing. `details.issues` lists each problem as `{ path, message }`. Correct the request before sending it again. HTTP status 400.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        ],
        "properties": {
          "error": {
            "properties": {
              "code": {
                "const": "validation_failed"
              },
              "type": {
                "const": "https://api.scopable.io/v1/openapi.json#/components/schemas/ValidationFailedError"
              }
            }
          }
        }
      },
      "UnauthorizedError": {
        "title": "Unauthorized",
        "description": "No credential was sent, or the one sent is unknown, expired or revoked. Send a valid API key as a bearer token. HTTP status 401.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        ],
        "properties": {
          "error": {
            "properties": {
              "code": {
                "const": "unauthorized"
              },
              "type": {
                "const": "https://api.scopable.io/v1/openapi.json#/components/schemas/UnauthorizedError"
              }
            }
          }
        }
      },
      "ForbiddenError": {
        "title": "Forbidden",
        "description": "The credential is valid but may not make this call: a scope is missing, or the workspace does not grant the permission it needs. `details.reason` names the refusal. HTTP status 403.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        ],
        "properties": {
          "error": {
            "properties": {
              "code": {
                "const": "forbidden"
              },
              "type": {
                "const": "https://api.scopable.io/v1/openapi.json#/components/schemas/ForbiddenError"
              }
            }
          }
        }
      },
      "NotFoundError": {
        "title": "Not found",
        "description": "No such record exists in the credential's workspace. A record in another workspace is also not found; the API never says whether it exists. HTTP status 404.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        ],
        "properties": {
          "error": {
            "properties": {
              "code": {
                "const": "not_found"
              },
              "type": {
                "const": "https://api.scopable.io/v1/openapi.json#/components/schemas/NotFoundError"
              }
            }
          }
        }
      },
      "ConflictError": {
        "title": "Conflict",
        "description": "The request conflicts with an earlier one: the Idempotency-Key was already used, or the record changed since it was read. `details.reason` names the conflict. HTTP status 409.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        ],
        "properties": {
          "error": {
            "properties": {
              "code": {
                "const": "conflict"
              },
              "type": {
                "const": "https://api.scopable.io/v1/openapi.json#/components/schemas/ConflictError"
              }
            }
          }
        }
      },
      "ApprovalRequiredError": {
        "title": "Approval required",
        "description": "The command was checked and recorded for a person to approve, and did not run. Sent with HTTP 202 to agent credentials only. `details` carries `approvalId`, `operationId`, `effect` and `expiresAt`. HTTP status 202.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        ],
        "properties": {
          "error": {
            "properties": {
              "code": {
                "const": "approval_required"
              },
              "type": {
                "const": "https://api.scopable.io/v1/openapi.json#/components/schemas/ApprovalRequiredError"
              }
            }
          }
        }
      },
      "RateLimitedError": {
        "title": "Rate limited",
        "description": "Too many requests in the current window. Wait the number of seconds in the Retry-After header, also given as `details.retryAfterSeconds`, before trying again. HTTP status 429.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        ],
        "properties": {
          "error": {
            "properties": {
              "code": {
                "const": "rate_limited"
              },
              "type": {
                "const": "https://api.scopable.io/v1/openapi.json#/components/schemas/RateLimitedError"
              }
            }
          }
        }
      },
      "UnavailableError": {
        "title": "Unavailable",
        "description": "The service could not complete the request: a dependency is down, or the workspace lacks a connection this operation needs. `details.reason` names the cause. Safe to retry later; quote the `requestId` when contacting support. HTTP status 503.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        ],
        "properties": {
          "error": {
            "properties": {
              "code": {
                "const": "unavailable"
              },
              "type": {
                "const": "https://api.scopable.io/v1/openapi.json#/components/schemas/UnavailableError"
              }
            }
          }
        }
      }
    }
  }
}
