{
  "openapi": "3.1.0",
  "info": {
    "title": "Klipy API",
    "version": "2",
    "description": "Klipy public CRM API, version 2."
  },
  "servers": [
    {
      "url": "https://api.klipy.ai/api/v2"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/bookings": {
      "get": {
        "operationId": "list_bookings",
        "summary": "list booking",
        "description": "Lists bookings, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` time-window filter.",
        "tags": [
          "bookings"
        ],
        "x-required-scope": "bookings:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "event_slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/bookings/{id}": {
      "get": {
        "operationId": "get_bookings",
        "summary": "get booking",
        "description": "Retrieves a single booking by id. Returns 404 if no booking with that id exists in the authenticated organization.",
        "tags": [
          "bookings"
        ],
        "x-required-scope": "bookings:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/companies": {
      "get": {
        "operationId": "list_companies",
        "summary": "list company",
        "description": "Lists companies, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` / `updated_since` time-window filters.",
        "tags": [
          "companies"
        ],
        "x-required-scope": "companies:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "owner_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "create_companies",
        "summary": "create company",
        "description": "Creates a new company. Requires the `companies:write` scope.",
        "tags": [
          "companies"
        ],
        "x-required-scope": "companies:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string"
                  },
                  "alt_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "arr": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "crunchbase": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "domain": {
                    "type": "string"
                  },
                  "facebook": {
                    "type": "string"
                  },
                  "founded_year": {
                    "type": "number"
                  },
                  "instagram": {
                    "type": "string"
                  },
                  "linkedin": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "num_employees": {
                    "type": "string"
                  },
                  "owner_id": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "primary_industry": {
                    "type": "string"
                  },
                  "remarks": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "twitter": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      },
      "put": {
        "operationId": "upsert_companies",
        "summary": "upsert company",
        "description": "Creates or updates a company, matched by its natural key. Returns the resulting record whether it was newly created or updated in place.",
        "tags": [
          "companies"
        ],
        "x-required-scope": "companies:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string"
                  },
                  "alt_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "arr": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "crunchbase": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "domain": {
                    "type": "string"
                  },
                  "facebook": {
                    "type": "string"
                  },
                  "founded_year": {
                    "type": "number"
                  },
                  "instagram": {
                    "type": "string"
                  },
                  "linkedin": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "num_employees": {
                    "type": "string"
                  },
                  "owner_id": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "primary_industry": {
                    "type": "string"
                  },
                  "remarks": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "twitter": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/companies/batch": {
      "post": {
        "operationId": "batchCreate_companies",
        "summary": "batch create company",
        "description": "Creates up to 100 companies in one request. Each item is processed independently (not atomic) — a failure on one item does not affect the others. Always returns 200; inspect `data.summary.failed` and each item's `status` to see what succeeded.",
        "tags": [
          "companies"
        ],
        "x-required-scope": "companies:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Batch"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "An array of up to 100 items to create. Each item is processed as an independent transaction; the response is a multi-status envelope.",
                "maxItems": 100,
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "alt_industries": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "arr": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "crunchbase": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "facebook": {
                      "type": "string"
                    },
                    "founded_year": {
                      "type": "number"
                    },
                    "instagram": {
                      "type": "string"
                    },
                    "linkedin": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "num_employees": {
                      "type": "string"
                    },
                    "owner_id": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "primary_industry": {
                      "type": "string"
                    },
                    "remarks": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "twitter": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/companies/{id}": {
      "get": {
        "operationId": "get_companies",
        "summary": "get company",
        "description": "Retrieves a single company by id. Returns 404 if no company with that id exists in the authenticated organization.",
        "tags": [
          "companies"
        ],
        "x-required-scope": "companies:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "update_companies",
        "summary": "update company",
        "description": "Updates fields on an existing company. Only the fields present in the request body are changed; omitted fields are left untouched. Returns 404 if no company with that id exists in the authenticated organization.",
        "tags": [
          "companies"
        ],
        "x-required-scope": "companies:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string"
                  },
                  "alt_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "arr": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "crunchbase": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "domain": {
                    "type": "string"
                  },
                  "facebook": {
                    "type": "string"
                  },
                  "founded_year": {
                    "type": "number"
                  },
                  "instagram": {
                    "type": "string"
                  },
                  "linkedin": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "num_employees": {
                    "type": "string"
                  },
                  "owner_id": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "primary_industry": {
                    "type": "string"
                  },
                  "remarks": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "twitter": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "remove_companies",
        "summary": "remove company",
        "description": "Permanently deletes a company by id. This cannot be undone. Returns 404 if no company with that id exists in the authenticated organization.",
        "tags": [
          "companies"
        ],
        "x-required-scope": "companies:delete",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/contacts": {
      "get": {
        "operationId": "list_contacts",
        "summary": "list contact",
        "description": "Lists contacts, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` / `updated_since` time-window filters.",
        "tags": [
          "contacts"
        ],
        "x-required-scope": "contacts:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "company_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "owner_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "create_contacts",
        "summary": "create contact",
        "description": "Creates a new contact. Requires the `contacts:write` scope.",
        "tags": [
          "contacts"
        ],
        "x-required-scope": "contacts:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alt_emails": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "company_id": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "first_name": {
                    "type": "string"
                  },
                  "keep_in_touch": {
                    "type": "boolean"
                  },
                  "last_name": {
                    "type": "string"
                  },
                  "owner_id": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "remarks": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        }
      },
      "put": {
        "operationId": "upsert_contacts",
        "summary": "upsert contact",
        "description": "Creates or updates a contact, matched by its natural key. Returns the resulting record whether it was newly created or updated in place.",
        "tags": [
          "contacts"
        ],
        "x-required-scope": "contacts:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alt_emails": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "company_id": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "first_name": {
                    "type": "string"
                  },
                  "keep_in_touch": {
                    "type": "boolean"
                  },
                  "last_name": {
                    "type": "string"
                  },
                  "owner_id": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "remarks": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        }
      }
    },
    "/contacts/batch": {
      "post": {
        "operationId": "batchCreate_contacts",
        "summary": "batch create contact",
        "description": "Creates up to 100 contacts in one request. Each item is processed independently (not atomic) — a failure on one item does not affect the others. Always returns 200; inspect `data.summary.failed` and each item's `status` to see what succeeded.",
        "tags": [
          "contacts"
        ],
        "x-required-scope": "contacts:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Batch"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "An array of up to 100 items to create. Each item is processed as an independent transaction; the response is a multi-status envelope.",
                "maxItems": 100,
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "alt_emails": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "company_id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "keep_in_touch": {
                      "type": "boolean"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "owner_id": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "remarks": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "email"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/contacts/{id}": {
      "get": {
        "operationId": "get_contacts",
        "summary": "get contact",
        "description": "Retrieves a single contact by id. Returns 404 if no contact with that id exists in the authenticated organization.",
        "tags": [
          "contacts"
        ],
        "x-required-scope": "contacts:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "update_contacts",
        "summary": "update contact",
        "description": "Updates fields on an existing contact. Only the fields present in the request body are changed; omitted fields are left untouched. Returns 404 if no contact with that id exists in the authenticated organization.",
        "tags": [
          "contacts"
        ],
        "x-required-scope": "contacts:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alt_emails": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "company_id": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "first_name": {
                    "type": "string"
                  },
                  "keep_in_touch": {
                    "type": "boolean"
                  },
                  "last_name": {
                    "type": "string"
                  },
                  "owner_id": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "remarks": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "remove_contacts",
        "summary": "remove contact",
        "description": "Permanently deletes a contact by id. This cannot be undone. Returns 404 if no contact with that id exists in the authenticated organization.",
        "tags": [
          "contacts"
        ],
        "x-required-scope": "contacts:delete",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/deals": {
      "get": {
        "operationId": "list_deals",
        "summary": "list deal",
        "description": "Lists deals, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` / `updated_since` time-window filters.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "owner_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pipeline_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "create_deals",
        "summary": "create deal",
        "description": "Creates a new deal. Requires the `deals:write` scope.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "main_contact_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "owner_id": {
                    "type": "string"
                  },
                  "pipeline_id": {
                    "type": "string"
                  },
                  "projected_close_date": {
                    "type": "number"
                  },
                  "stage": {
                    "type": "string"
                  },
                  "value": {
                    "type": "object",
                    "properties": {
                      "amount": {
                        "type": "number"
                      },
                      "currency": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "amount",
                      "currency"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/deals/batch": {
      "post": {
        "operationId": "batchCreate_deals",
        "summary": "batch create deal",
        "description": "Creates up to 100 deals in one request. Each item is processed independently (not atomic) — a failure on one item does not affect the others. Always returns 200; inspect `data.summary.failed` and each item's `status` to see what succeeded.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Batch"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "An array of up to 100 items to create. Each item is processed as an independent transaction; the response is a multi-status envelope.",
                "maxItems": 100,
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "main_contact_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "owner_id": {
                      "type": "string"
                    },
                    "pipeline_id": {
                      "type": "string"
                    },
                    "projected_close_date": {
                      "type": "number"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "value": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "amount",
                        "currency"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/deals/{id}": {
      "get": {
        "operationId": "get_deals",
        "summary": "get deal",
        "description": "Retrieves a single deal by id. Returns 404 if no deal with that id exists in the authenticated organization.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "update_deals",
        "summary": "update deal",
        "description": "Updates fields on an existing deal. Only the fields present in the request body are changed; omitted fields are left untouched. Returns 404 if no deal with that id exists in the authenticated organization.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "main_contact_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "owner_id": {
                    "type": "string"
                  },
                  "pipeline_id": {
                    "type": "string"
                  },
                  "projected_close_date": {
                    "type": "number"
                  },
                  "stage": {
                    "type": "string"
                  },
                  "value": {
                    "type": "object",
                    "properties": {
                      "amount": {
                        "type": "number"
                      },
                      "currency": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "amount",
                      "currency"
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "remove_deals",
        "summary": "remove deal",
        "description": "Permanently deletes a deal by id. This cannot be undone. Returns 404 if no deal with that id exists in the authenticated organization.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:delete",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/deals/{id}/companies": {
      "get": {
        "operationId": "list_deals_companies",
        "summary": "list deal company",
        "description": "Lists the companies linked to this deal. Supports cursor pagination via the `cursor` and `limit` query parameters.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "link_deals_companies",
        "summary": "link deal company",
        "description": "Links an existing company to this deal. Idempotent — linking an already-linked record is a no-op.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "company_id"
                ]
              }
            }
          }
        }
      }
    },
    "/deals/{id}/companies/{company_id}": {
      "delete": {
        "operationId": "unlink_deals_companies",
        "summary": "unlink deal company",
        "description": "Unlinks a company from this deal. The company itself is not deleted; only the link between them is removed.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:write",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/deals/{id}/contacts": {
      "get": {
        "operationId": "list_deals_contacts",
        "summary": "list deal contact",
        "description": "Lists the contacts linked to this deal. Supports cursor pagination via the `cursor` and `limit` query parameters.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "link_deals_contacts",
        "summary": "link deal contact",
        "description": "Links an existing contact to this deal. Idempotent — linking an already-linked record is a no-op.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contact_id": {
                    "type": "string"
                  },
                  "supervisor": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "PRIMARY",
                      "DECISION_MAKER",
                      "CHAMPION",
                      "INFLUENCER",
                      "GATEKEEPER",
                      "BLOCKER",
                      "PROCUREMENT",
                      "END_USER",
                      "TECHNICAL_EVALUATOR",
                      "ECONOMIC_BUYER",
                      "EXECUTIVE_SPONSOR",
                      "COACH"
                    ]
                  }
                },
                "required": [
                  "contact_id"
                ]
              }
            }
          }
        }
      }
    },
    "/deals/{id}/contacts/{contact_id}": {
      "delete": {
        "operationId": "unlink_deals_contacts",
        "summary": "unlink deal contact",
        "description": "Unlinks a contact from this deal. The contact itself is not deleted; only the link between them is removed.",
        "tags": [
          "deals"
        ],
        "x-required-scope": "deals:write",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/interactions": {
      "get": {
        "operationId": "list_interactions",
        "summary": "list interaction",
        "description": "Lists interactions, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` time-window filter.",
        "tags": [
          "interactions"
        ],
        "x-required-scope": "interactions:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "company_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "create_interactions",
        "summary": "create interaction",
        "description": "Creates a new interaction. Requires the `interactions:write` scope.",
        "tags": [
          "interactions"
        ],
        "x-required-scope": "interactions:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contact_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "direction": {
                    "enum": [
                      "INBOUND",
                      "OUTBOUND",
                      "HYBRID",
                      "INTERNAL",
                      "EVENT"
                    ]
                  },
                  "interaction_date": {
                    "type": "number"
                  },
                  "summary": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "MANUAL",
                      "MEMO",
                      "DIRECT_MESSAGE"
                    ]
                  }
                },
                "required": [
                  "contact_ids",
                  "direction",
                  "interaction_date",
                  "title",
                  "type"
                ]
              }
            }
          }
        }
      }
    },
    "/interactions/batch": {
      "post": {
        "operationId": "batchCreate_interactions",
        "summary": "batch create interaction",
        "description": "Creates up to 100 interactions in one request. Each item is processed independently (not atomic) — a failure on one item does not affect the others. Always returns 200; inspect `data.summary.failed` and each item's `status` to see what succeeded.",
        "tags": [
          "interactions"
        ],
        "x-required-scope": "interactions:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Batch"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "An array of up to 100 items to create. Each item is processed as an independent transaction; the response is a multi-status envelope.",
                "maxItems": 100,
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "contact_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "direction": {
                      "enum": [
                        "INBOUND",
                        "OUTBOUND",
                        "HYBRID",
                        "INTERNAL",
                        "EVENT"
                      ]
                    },
                    "interaction_date": {
                      "type": "number"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "MANUAL",
                        "MEMO",
                        "DIRECT_MESSAGE"
                      ]
                    }
                  },
                  "required": [
                    "contact_ids",
                    "direction",
                    "interaction_date",
                    "title",
                    "type"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/interactions/{id}": {
      "get": {
        "operationId": "get_interactions",
        "summary": "get interaction",
        "description": "Retrieves a single interaction by id. Returns 404 if no interaction with that id exists in the authenticated organization.",
        "tags": [
          "interactions"
        ],
        "x-required-scope": "interactions:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/meetings": {
      "get": {
        "operationId": "list_meetings",
        "summary": "list meeting",
        "description": "Lists meetings, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` time-window filter.",
        "tags": [
          "meetings"
        ],
        "x-required-scope": "meetings:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "company_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deal_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/meetings/{id}": {
      "get": {
        "operationId": "get_meetings",
        "summary": "get meeting",
        "description": "Retrieves a single meeting by id. Returns 404 if no meeting with that id exists in the authenticated organization.",
        "tags": [
          "meetings"
        ],
        "x-required-scope": "meetings:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/meetings/{id}/company": {
      "get": {
        "operationId": "get_meetings_company",
        "summary": "get meeting company",
        "description": "Returns the company associated with this meeting, or `null` in `data` if none is set.",
        "tags": [
          "meetings"
        ],
        "x-required-scope": "meetings:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "put": {
        "operationId": "set_meetings_company",
        "summary": "set meeting company",
        "description": "Sets (or replaces) the company associated with this meeting.",
        "tags": [
          "meetings"
        ],
        "x-required-scope": "meetings:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "company_id"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "clear_meetings_company",
        "summary": "clear meeting company",
        "description": "Clears the company association from this meeting. Idempotent — clearing an already-empty association returns 204.",
        "tags": [
          "meetings"
        ],
        "x-required-scope": "meetings:write",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/meetings/{id}/deal": {
      "get": {
        "operationId": "get_meetings_deal",
        "summary": "get meeting deal",
        "description": "Returns the deal associated with this meeting, or `null` in `data` if none is set.",
        "tags": [
          "meetings"
        ],
        "x-required-scope": "meetings:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "put": {
        "operationId": "set_meetings_deal",
        "summary": "set meeting deal",
        "description": "Sets (or replaces) the deal associated with this meeting.",
        "tags": [
          "meetings"
        ],
        "x-required-scope": "meetings:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deal_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "deal_id"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "clear_meetings_deal",
        "summary": "clear meeting deal",
        "description": "Clears the deal association from this meeting. Idempotent — clearing an already-empty association returns 204.",
        "tags": [
          "meetings"
        ],
        "x-required-scope": "meetings:write",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/notes": {
      "get": {
        "operationId": "list_notes",
        "summary": "list note",
        "description": "Lists notes, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` / `updated_since` time-window filters.",
        "tags": [
          "notes"
        ],
        "x-required-scope": "notes:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "parent_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "create_notes",
        "summary": "create note",
        "description": "Creates a new note. Requires the `notes:write` scope.",
        "tags": [
          "notes"
        ],
        "x-required-scope": "notes:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "parent_id": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notes/batch": {
      "post": {
        "operationId": "batchCreate_notes",
        "summary": "batch create note",
        "description": "Creates up to 100 notes in one request. Each item is processed independently (not atomic) — a failure on one item does not affect the others. Always returns 200; inspect `data.summary.failed` and each item's `status` to see what succeeded.",
        "tags": [
          "notes"
        ],
        "x-required-scope": "notes:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Batch"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "An array of up to 100 items to create. Each item is processed as an independent transaction; the response is a multi-status envelope.",
                "maxItems": 100,
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "parent_id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notes/{id}": {
      "get": {
        "operationId": "get_notes",
        "summary": "get note",
        "description": "Retrieves a single note by id. Returns 404 if no note with that id exists in the authenticated organization.",
        "tags": [
          "notes"
        ],
        "x-required-scope": "notes:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "update_notes",
        "summary": "update note",
        "description": "Updates fields on an existing note. Only the fields present in the request body are changed; omitted fields are left untouched. Returns 404 if no note with that id exists in the authenticated organization.",
        "tags": [
          "notes"
        ],
        "x-required-scope": "notes:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "is_archived": {
                    "type": "boolean"
                  },
                  "parent_id": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "remove_notes",
        "summary": "remove note",
        "description": "Permanently deletes a note by id. This cannot be undone. Returns 404 if no note with that id exists in the authenticated organization.",
        "tags": [
          "notes"
        ],
        "x-required-scope": "notes:delete",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/notes/{id}/records": {
      "get": {
        "operationId": "list_notes_records",
        "summary": "list note record",
        "description": "Lists the records linked to this note. Supports cursor pagination via the `cursor` and `limit` query parameters.",
        "tags": [
          "notes"
        ],
        "x-required-scope": "notes:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "link_notes_records",
        "summary": "link note record",
        "description": "Links an existing record to this note. Idempotent — linking an already-linked record is a no-op. The request body must specify a `record_type` (one of `contacts`, `companies`, `deals`) alongside the target record id.",
        "tags": [
          "notes"
        ],
        "x-required-scope": "notes:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "record_id": {
                    "type": "string"
                  },
                  "record_type": {
                    "enum": [
                      "contacts",
                      "companies",
                      "deals"
                    ]
                  }
                },
                "required": [
                  "record_id",
                  "record_type"
                ]
              }
            }
          }
        }
      }
    },
    "/notes/{id}/records/{record_id}": {
      "delete": {
        "operationId": "unlink_notes_records",
        "summary": "unlink note record",
        "description": "Unlinks a record from this note. The record itself is not deleted; only the link between them is removed.",
        "tags": [
          "notes"
        ],
        "x-required-scope": "notes:write",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/pipelines": {
      "get": {
        "operationId": "list_pipelines",
        "summary": "list pipeline",
        "description": "Lists pipelines, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` time-window filter.",
        "tags": [
          "pipelines"
        ],
        "x-required-scope": "pipelines:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "create_pipelines",
        "summary": "create pipeline",
        "description": "Creates a new pipeline. Requires the `pipelines:write` scope.",
        "tags": [
          "pipelines"
        ],
        "x-required-scope": "pipelines:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "closed_lost_stage": {
                    "type": "object",
                    "properties": {
                      "index": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "index",
                      "name"
                    ]
                  },
                  "closed_won_stage": {
                    "type": "object",
                    "properties": {
                      "index": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "index",
                      "name"
                    ]
                  },
                  "default_ui": {
                    "enum": [
                      "kanban",
                      "list"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "is_default": {
                    "type": "boolean"
                  },
                  "is_public": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "stages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "color": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "index": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "variant": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "color",
                        "id",
                        "index",
                        "name",
                        "variant"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/pipelines/batch": {
      "post": {
        "operationId": "batchCreate_pipelines",
        "summary": "batch create pipeline",
        "description": "Creates up to 100 pipelines in one request. Each item is processed independently (not atomic) — a failure on one item does not affect the others. Always returns 200; inspect `data.summary.failed` and each item's `status` to see what succeeded.",
        "tags": [
          "pipelines"
        ],
        "x-required-scope": "pipelines:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Batch"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "An array of up to 100 items to create. Each item is processed as an independent transaction; the response is a multi-status envelope.",
                "maxItems": 100,
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "closed_lost_stage": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "index",
                        "name"
                      ]
                    },
                    "closed_won_stage": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "index",
                        "name"
                      ]
                    },
                    "default_ui": {
                      "enum": [
                        "kanban",
                        "list"
                      ]
                    },
                    "description": {
                      "type": "string"
                    },
                    "is_default": {
                      "type": "boolean"
                    },
                    "is_public": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "stages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "color": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "index": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "variant": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "color",
                          "id",
                          "index",
                          "name",
                          "variant"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/pipelines/{id}": {
      "get": {
        "operationId": "get_pipelines",
        "summary": "get pipeline",
        "description": "Retrieves a single pipeline by id. Returns 404 if no pipeline with that id exists in the authenticated organization.",
        "tags": [
          "pipelines"
        ],
        "x-required-scope": "pipelines:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "update_pipelines",
        "summary": "update pipeline",
        "description": "Updates fields on an existing pipeline. Only the fields present in the request body are changed; omitted fields are left untouched. Returns 404 if no pipeline with that id exists in the authenticated organization.",
        "tags": [
          "pipelines"
        ],
        "x-required-scope": "pipelines:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "closed_lost_stage": {
                    "type": "object",
                    "properties": {
                      "index": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "index",
                      "name"
                    ]
                  },
                  "closed_won_stage": {
                    "type": "object",
                    "properties": {
                      "index": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "index",
                      "name"
                    ]
                  },
                  "default_ui": {
                    "enum": [
                      "kanban",
                      "list"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "is_default": {
                    "type": "boolean"
                  },
                  "is_public": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "stages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "color": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "index": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "variant": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "color",
                        "id",
                        "index",
                        "name",
                        "variant"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "remove_pipelines",
        "summary": "remove pipeline",
        "description": "Permanently deletes a pipeline by id. This cannot be undone. Returns 404 if no pipeline with that id exists in the authenticated organization.",
        "tags": [
          "pipelines"
        ],
        "x-required-scope": "pipelines:delete",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/recordings": {
      "get": {
        "operationId": "list_recordings",
        "summary": "list recording",
        "description": "Lists recordings, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` time-window filter.",
        "tags": [
          "recordings"
        ],
        "x-required-scope": "recordings:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "meeting_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/recordings/{id}": {
      "get": {
        "operationId": "get_recordings",
        "summary": "get recording",
        "description": "Retrieves a single recording by id. Returns 404 if no recording with that id exists in the authenticated organization.",
        "tags": [
          "recordings"
        ],
        "x-required-scope": "recordings:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/segments": {
      "get": {
        "operationId": "list_segments",
        "summary": "list segment",
        "description": "Lists segments, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` time-window filter.",
        "tags": [
          "segments"
        ],
        "x-required-scope": "segments:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "create_segments",
        "summary": "create segment",
        "description": "Creates a new segment. Requires the `segments:write` scope.",
        "tags": [
          "segments"
        ],
        "x-required-scope": "segments:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "color": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "variant": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/segments/batch": {
      "post": {
        "operationId": "batchCreate_segments",
        "summary": "batch create segment",
        "description": "Creates up to 100 segments in one request. Each item is processed independently (not atomic) — a failure on one item does not affect the others. Always returns 200; inspect `data.summary.failed` and each item's `status` to see what succeeded.",
        "tags": [
          "segments"
        ],
        "x-required-scope": "segments:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Batch"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "An array of up to 100 items to create. Each item is processed as an independent transaction; the response is a multi-status envelope.",
                "maxItems": 100,
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "color": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "variant": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/segments/{id}": {
      "get": {
        "operationId": "get_segments",
        "summary": "get segment",
        "description": "Retrieves a single segment by id. Returns 404 if no segment with that id exists in the authenticated organization.",
        "tags": [
          "segments"
        ],
        "x-required-scope": "segments:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "update_segments",
        "summary": "update segment",
        "description": "Updates fields on an existing segment. Only the fields present in the request body are changed; omitted fields are left untouched. Returns 404 if no segment with that id exists in the authenticated organization.",
        "tags": [
          "segments"
        ],
        "x-required-scope": "segments:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "color": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "variant": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "remove_segments",
        "summary": "remove segment",
        "description": "Permanently deletes a segment by id. This cannot be undone. Returns 404 if no segment with that id exists in the authenticated organization.",
        "tags": [
          "segments"
        ],
        "x-required-scope": "segments:delete",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/segments/{id}/members": {
      "get": {
        "operationId": "list_segments_members",
        "summary": "list segment member",
        "description": "Lists the members linked to this segment. Supports cursor pagination via the `cursor` and `limit` query parameters.",
        "tags": [
          "segments"
        ],
        "x-required-scope": "segments:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "link_segments_members",
        "summary": "link segment member",
        "description": "Links an existing member to this segment. Idempotent — linking an already-linked record is a no-op. The request body must specify a `record_type` (one of `contacts`, `companies`, `deals`, `tasks`, `interactions`) alongside the target record id.",
        "tags": [
          "segments"
        ],
        "x-required-scope": "segments:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "record_id": {
                    "type": "string"
                  },
                  "record_type": {
                    "enum": [
                      "contacts",
                      "companies",
                      "deals",
                      "tasks",
                      "interactions"
                    ]
                  }
                },
                "required": [
                  "record_id",
                  "record_type"
                ]
              }
            }
          }
        }
      }
    },
    "/segments/{id}/members/{record_id}": {
      "delete": {
        "operationId": "unlink_segments_members",
        "summary": "unlink segment member",
        "description": "Unlinks a member from this segment. The member itself is not deleted; only the link between them is removed.",
        "tags": [
          "segments"
        ],
        "x-required-scope": "segments:write",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/tasks": {
      "get": {
        "operationId": "list_tasks",
        "summary": "list task",
        "description": "Lists tasks, ordered by `created_at` (descending) by default. Supports cursor pagination via the `cursor` and `limit` query parameters. It also supports the `created_since` time-window filter.",
        "tags": [
          "tasks"
        ],
        "x-required-scope": "tasks:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "company_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deal_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "person_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "create_tasks",
        "summary": "create task",
        "description": "Creates a new task. Requires the `tasks:write` scope.",
        "tags": [
          "tasks"
        ],
        "x-required-scope": "tasks:write",
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_id": {
                    "type": "string"
                  },
                  "deal_id": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "done": {
                    "type": "boolean"
                  },
                  "due_date": {
                    "type": "number"
                  },
                  "main_assignee_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "person_id": {
                    "type": "string"
                  },
                  "urgency": {
                    "enum": [
                      "low",
                      "medium",
                      "high",
                      "critical"
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/tasks/batch": {
      "post": {
        "operationId": "batchCreate_tasks",
        "summary": "batch create task",
        "description": "Creates up to 100 tasks in one request. Each item is processed independently (not atomic) — a failure on one item does not affect the others. Always returns 200; inspect `data.summary.failed` and each item's `status` to see what succeeded.",
        "tags": [
          "tasks"
        ],
        "x-required-scope": "tasks:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Batch"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "An array of up to 100 items to create. Each item is processed as an independent transaction; the response is a multi-status envelope.",
                "maxItems": 100,
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "company_id": {
                      "type": "string"
                    },
                    "deal_id": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "done": {
                      "type": "boolean"
                    },
                    "due_date": {
                      "type": "number"
                    },
                    "main_assignee_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "person_id": {
                      "type": "string"
                    },
                    "urgency": {
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "critical"
                      ]
                    }
                  },
                  "required": [
                    "name"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{id}": {
      "get": {
        "operationId": "get_tasks",
        "summary": "get task",
        "description": "Retrieves a single task by id. Returns 404 if no task with that id exists in the authenticated organization.",
        "tags": [
          "tasks"
        ],
        "x-required-scope": "tasks:read",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "update_tasks",
        "summary": "update task",
        "description": "Updates fields on an existing task. Only the fields present in the request body are changed; omitted fields are left untouched. Returns 404 if no task with that id exists in the authenticated organization.",
        "tags": [
          "tasks"
        ],
        "x-required-scope": "tasks:write",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_id": {
                    "type": "string"
                  },
                  "deal_id": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "done": {
                    "type": "boolean"
                  },
                  "due_date": {
                    "type": "number"
                  },
                  "main_assignee_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "person_id": {
                    "type": "string"
                  },
                  "urgency": {
                    "enum": [
                      "low",
                      "medium",
                      "high",
                      "critical"
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "remove_tasks",
        "summary": "remove task",
        "description": "Permanently deletes a task by id. This cannot be undone. Returns 404 if no task with that id exists in the authenticated organization.",
        "tags": [
          "tasks"
        ],
        "x-required-scope": "tasks:delete",
        "responses": {
          "204": {
            "$ref": "#/components/responses/NoContent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/transcripts/download": {
      "get": {
        "operationId": "download_transcript",
        "summary": "download transcript",
        "description": "Downloads a meeting transcript using the short-lived, single-use `token` a recording's detail response supplies as `transcript_url`. The token is a capability grant, not an API key: it is NOT sent via the `X-Klipy-Api-Key` header or a Bearer token, and this endpoint is unauthenticated apart from the token itself. Every deny — missing, expired, or already-used token; revoked API key; cross-org grant — returns the SAME generic 404 so a caller cannot enumerate valid tokens or recordings.",
        "tags": [
          "transcripts"
        ],
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "description": "The short-lived, single-use capability token from the recording detail response's `transcript_url`. Not an API key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The transcript body: a JSON array of transcript chunks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "404": {
            "description": "No token, or the token is invalid, expired, already used, or bound to a revoked key or a different organization. Deliberately non-enumerating: every deny reason returns this same response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Klipy-Api-Key"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "responses": {
      "Success": {
        "description": "Success.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SuccessEnvelope"
            }
          }
        }
      },
      "List": {
        "description": "A paginated list of resources.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ListEnvelope"
            }
          }
        }
      },
      "Batch": {
        "description": "A batch-create multi-status result. Always 200; per-item outcomes and a summary live in the body.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BatchEnvelope"
            }
          }
        }
      },
      "Created": {
        "description": "Resource created.",
        "headers": {
          "Location": {
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SuccessEnvelope"
            }
          }
        }
      },
      "NoContent": {
        "description": "No content."
      },
      "Unauthorized": {
        "description": "Authentication failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Insufficient scope or forbidden operation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "ValidationFailed": {
        "description": "Request body validation failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal server error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      }
    },
    "schemas": {
      "Meta": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SuccessEnvelope": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object"
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "object": {
            "type": "string"
          }
        }
      },
      "PageInfo": {
        "type": "object",
        "properties": {
          "end_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_next_page": {
            "type": "boolean"
          }
        }
      },
      "ListEnvelope": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "object": {
            "type": "string"
          },
          "page_info": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "BatchItemResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "message": {
                "type": "string"
              }
            }
          },
          "index": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "error"
            ]
          }
        }
      },
      "BatchSummary": {
        "type": "object",
        "properties": {
          "failed": {
            "type": "integer"
          },
          "succeeded": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "BatchEnvelope": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BatchItemResult"
                }
              },
              "summary": {
                "$ref": "#/components/schemas/BatchSummary"
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "object": {
            "type": "string"
          }
        }
      },
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "message": {
                "type": "string"
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "object": {
            "type": "string"
          }
        }
      }
    }
  }
}
