{
  "openapi": "3.1.0",
  "info": {
    "title": "LeadArc Inbox API",
    "version": "1.0.0",
    "summary": "Read and act on cold email replies in the LeadArc Master Inbox.",
    "description": "Server to server only: there are no CORS headers and a key must never reach a browser.\n\nRate limits per key: 120/min read, 60/min write, 10/min upstream, plus 4 requests in flight.\n\nPagination is cursor based. Ids are opaque. Timestamps are ISO 8601 UTC."
  },
  "servers": [
    {
      "url": "https://api.leadarc.io",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Meta"
    },
    {
      "name": "Workspaces and members"
    },
    {
      "name": "Templates and assets"
    },
    {
      "name": "Campaigns"
    },
    {
      "name": "Event types and slots"
    },
    {
      "name": "Insights"
    },
    {
      "name": "Leads"
    },
    {
      "name": "Meetings"
    },
    {
      "name": "Notes"
    },
    {
      "name": "Sequences"
    },
    {
      "name": "Tasks"
    }
  ],
  "paths": {
    "/v1/capabilities": {
      "get": {
        "summary": "Every enum value, limit, and filter this version accepts",
        "description": "No scope required. Rate bucket: `read`.",
        "operationId": "getV1Capabilities",
        "tags": [
          "Meta"
        ],
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "summary": "Who this key is, what it may do, which workspaces it currently reaches",
        "description": "No scope required. Rate bucket: `read`.",
        "operationId": "getV1Me",
        "tags": [
          "Meta"
        ],
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces": {
      "get": {
        "summary": "List the workspaces this key reaches",
        "description": "Requires the `workspaces:read` scope. Rate bucket: `read`.",
        "operationId": "getV1Workspaces",
        "tags": [
          "Workspaces and members"
        ],
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/workspace"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}": {
      "get": {
        "summary": "One workspace",
        "description": "Requires the `workspaces:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWs",
        "tags": [
          "Workspaces and members"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/workspace"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/assets": {
      "get": {
        "summary": "Looms, docs, links, snippets",
        "description": "Requires the `assets:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsAssets",
        "tags": [
          "Templates and assets"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/asset"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/campaign_tags": {
      "get": {
        "summary": "Campaign tags, the match key for rules and notes",
        "description": "Requires the `campaigns:read` scope. Rate bucket: `upstream`.",
        "operationId": "getV1WorkspacesWsCampaign_tags",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/campaign_tag"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/campaigns": {
      "get": {
        "summary": "The EmailBison campaign roster",
        "description": "Requires the `campaigns:read` scope. Rate bucket: `upstream`. Note: proxied live from EmailBison; can be stale or fail with 502.",
        "operationId": "getV1WorkspacesWsCampaigns",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/campaign"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/event_types": {
      "get": {
        "summary": "Bookable event types",
        "description": "Requires the `event_types:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsEvent_types",
        "tags": [
          "Event types and slots"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "public",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/event_type"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/event_types/{id}": {
      "get": {
        "summary": "One event type with hosts and form fields",
        "description": "Requires the `event_types:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsEvent_typesId",
        "tags": [
          "Event types and slots"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_type"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/event_types/{id}/slots": {
      "get": {
        "summary": "Free slots in a window",
        "description": "Requires the `event_types:read` scope. Rate bucket: `upstream`.",
        "operationId": "getV1WorkspacesWsEvent_typesIdSlots",
        "tags": [
          "Event types and slots"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/availability"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/insights/campaigns": {
      "get": {
        "summary": "Per-campaign and per-step metrics",
        "description": "Requires the `insights:read` scope. Rate bucket: `upstream`.",
        "operationId": "getV1WorkspacesWsInsightsCampaigns",
        "tags": [
          "Insights"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/campaign_insight"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/insights/daily": {
      "get": {
        "summary": "Dense daily series, max 120 days",
        "description": "Requires the `insights:read` scope. Rate bucket: `upstream`.",
        "operationId": "getV1WorkspacesWsInsightsDaily",
        "tags": [
          "Insights"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/daily_point"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/insights/summary": {
      "get": {
        "summary": "Funnel, rates, speed to lead, per-rep",
        "description": "Requires the `insights:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsInsightsSummary",
        "tags": [
          "Insights"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "member_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insights_summary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads": {
      "get": {
        "summary": "Filtered, paginated lead feed, one row per lead",
        "description": "Requires the `leads:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsLeads",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assignee_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "has_open_task",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "task_due_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "meeting_outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "unread",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "responded",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/lead"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}": {
      "get": {
        "summary": "One lead with rollups",
        "description": "Requires the `leads:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsLeadsLead",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/lead"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}/assignees": {
      "get": {
        "summary": "Who owns this lead",
        "description": "Requires the `leads:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsLeadsLeadAssignees",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/member"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Replace the assignee set",
        "description": "Requires the `leads:write` scope. Rate bucket: `write`.",
        "operationId": "putV1WorkspacesWsLeadsLeadAssignees",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/member"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "member_ids": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}/booked": {
      "post": {
        "summary": "Mark booked, local only",
        "description": "Requires the `leads:write` scope. Rate bucket: `write`. Note: soft-completes the lead's open tasks; local only, EmailBison is untouched.",
        "operationId": "postV1WorkspacesWsLeadsLeadBooked",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/lead"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "create_meeting": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}/disqualified": {
      "post": {
        "summary": "Mark disqualified, local only",
        "description": "Requires the `leads:write` scope. Rate bucket: `write`. Note: soft-completes the lead's open tasks; local only, EmailBison is untouched.",
        "operationId": "postV1WorkspacesWsLeadsLeadDisqualified",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/lead"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reengage_approved": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}/messages": {
      "get": {
        "summary": "Full merged conversation, inbound and outbound",
        "description": "Requires the `threads:read` scope. Rate bucket: `read`. Note: most expensive read in the API; single lead only, never expandable on a list.",
        "operationId": "getV1WorkspacesWsLeadsLeadMessages",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/message"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}/read": {
      "post": {
        "summary": "Mark read for the key's owner",
        "description": "Requires the `leads:write` scope. Rate bucket: `write`.",
        "operationId": "postV1WorkspacesWsLeadsLeadRead",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/lead"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}/replies": {
      "get": {
        "summary": "Every indexed inbound reply from this lead",
        "description": "Requires the `leads:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsLeadsLeadReplies",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/reply"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}/responded": {
      "post": {
        "summary": "Team-wide \"handled\", drops it from every rep's Daily",
        "description": "Requires the `leads:write` scope. Rate bucket: `write`. Note: team-wide marker: clears the lead from EVERY rep's worklist.",
        "operationId": "postV1WorkspacesWsLeadsLeadResponded",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/lead"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}/status": {
      "post": {
        "summary": "Set the SDR tag",
        "description": "Requires the `leads:write` scope. Rate bucket: `write`. Note: not_interested and unsubscribed soft-complete every open task on the lead.",
        "operationId": "postV1WorkspacesWsLeadsLeadStatus",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/lead"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/leads/{lead}/unread": {
      "post": {
        "summary": "Clear the read receipt",
        "description": "Requires the `leads:write` scope. Rate bucket: `write`.",
        "operationId": "postV1WorkspacesWsLeadsLeadUnread",
        "tags": [
          "Leads"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/lead"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/meetings": {
      "get": {
        "summary": "Paginated meeting feed",
        "description": "Requires the `meetings:read` scope. Rate bucket: `upstream`. Note: times can lag a host-side calendar change by up to 15 minutes.",
        "operationId": "getV1WorkspacesWsMeetings",
        "tags": [
          "Meetings"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "host_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_type_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "booked_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "booked_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "starts_after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "starts_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/meeting"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/meetings/{id}": {
      "get": {
        "summary": "One meeting",
        "description": "Requires the `meetings:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsMeetingsId",
        "tags": [
          "Meetings"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/meeting"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/meetings/{id}/outcome": {
      "post": {
        "summary": "Showed, no-show, cancelled, rescheduled",
        "description": "Requires the `meetings:write` scope. Rate bucket: `write`.",
        "operationId": "postV1WorkspacesWsMeetingsIdOutcome",
        "tags": [
          "Meetings"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/meeting"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "outcome": {},
                  "force": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/members": {
      "get": {
        "summary": "People who can work this workspace",
        "description": "Requires the `members:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsMembers",
        "tags": [
          "Workspaces and members"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assignable",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/member"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/notes": {
      "get": {
        "summary": "Notes, filterable by lead",
        "description": "Requires the `notes:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsNotes",
        "tags": [
          "Notes"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "author_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/note"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add a note to a lead",
        "description": "Requires the `notes:write` scope. Rate bucket: `write`. Note: not idempotent: a retry creates a second note.",
        "operationId": "postV1WorkspacesWsNotes",
        "tags": [
          "Notes"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/note"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lead_id": {},
                  "body": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/sequences": {
      "get": {
        "summary": "Follow-up sequences with steps",
        "description": "Requires the `sequences:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsSequences",
        "tags": [
          "Sequences"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "visibility",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/sequence"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/tasks": {
      "get": {
        "summary": "Tasks, filterable by lead, assignee, due date, status",
        "description": "Requires the `tasks:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsTasks",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assignee_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "due_after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "due_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "task_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/task"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a task on a lead",
        "description": "Requires the `tasks:write` scope. Rate bucket: `write`. Note: not idempotent: a retry creates a second task.",
        "operationId": "postV1WorkspacesWsTasks",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/task"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lead_id": {},
                  "due_date": {},
                  "due_time": {},
                  "notes": {},
                  "assignee_id": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/tasks/{id}": {
      "delete": {
        "summary": "Soft-delete a task",
        "description": "Requires the `tasks:write` scope. Rate bucket: `write`. Note: soft delete: sets a deleted timestamp, the row survives.",
        "operationId": "deleteV1WorkspacesWsTasksId",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/task"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Edit due date, time, notes, assignee",
        "description": "Requires the `tasks:write` scope. Rate bucket: `write`.",
        "operationId": "patchV1WorkspacesWsTasksId",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/task"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "due_date": {},
                  "due_time": {},
                  "notes": {},
                  "assignee_id": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/tasks/{id}/complete": {
      "post": {
        "summary": "Complete a task",
        "description": "Requires the `tasks:write` scope. Rate bucket: `write`.",
        "operationId": "postV1WorkspacesWsTasksIdComplete",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/task"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "completed": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/template_folders": {
      "get": {
        "summary": "Folders with counts",
        "description": "Requires the `templates:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsTemplate_folders",
        "tags": [
          "Templates and assets"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/template_folder"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/templates": {
      "get": {
        "summary": "Reply templates",
        "description": "Requires the `templates:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsTemplates",
        "tags": [
          "Templates and assets"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "folder_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "visibility",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/template"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/templates/{id}": {
      "get": {
        "summary": "One template",
        "description": "Requires the `templates:read` scope. Rate bucket: `read`.",
        "operationId": "getV1WorkspacesWsTemplatesId",
        "tags": [
          "Templates and assets"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/template"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{ws}/templates/{id}/render": {
      "post": {
        "summary": "Fill the variables for a lead. Read this before sending anything.",
        "description": "Requires the `templates:read` scope. Rate bucket: `read`. Note: call this before sending any template body: raw bodies still contain {{tokens}}.",
        "operationId": "postV1WorkspacesWsTemplatesIdRender",
        "tags": [
          "Templates and assets"
        ],
        "parameters": [
          {
            "name": "ws",
            "in": "path",
            "required": true,
            "description": "Workspace slug. The slug is the workspace id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Opaque object id as returned by this API.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, filter, cursor or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, or a workspace this key cannot reach",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "No such object, or it belongs to another workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or concurrency limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Our bug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lead_id": {},
                  "resolve_ai_variables": {},
                  "overrides": {}
                },
                "additionalProperties": false,
                "description": "Bodies are strict: an unrecognised field is rejected."
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A LeadArc API key: `lak_live_<handle>_<secret>`."
      }
    },
    "schemas": {
      "workspace": {
        "type": "object",
        "description": "id is the SLUG, not clients.id. The slug is already the public handle everywhere in this product (it is in every internal URL), it is stable, and it reads well in a caller's code. clients.id is a serial that appears inside signed object ids and never on its own. synced_at is published under its real name. It is when the sync-eb-workspaces cron last reconciled the workspace against EmailBison, so calling it created_at would invent a meaning for a value that moves every six hours. counts and sdr_notes are present only when the caller asked for them via ?include=. Pass undefined to leave the key ",
        "properties": {
          "object": {
            "const": "workspace"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "features": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "granted_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "synced_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "counts": {},
          "sdr_notes": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "domain",
          "logo_url",
          "active",
          "features",
          "granted_scopes",
          "synced_at"
        ]
      },
      "member": {
        "type": "object",
        "description": "email is users.google_email: the table has no email column, the sign-in identity is the Google address. role goes through normalizeRole, which returns only admin or user. Seven legacy values still sit in the column (internal_sdr, client_sdr, client_viewer, client_ae, sdr, client, client_sdr_airpay) and all fold to user, so a caller never has to know they existed. active is the boolean form of deactivated_at. The timestamp itself stays private: when a person was offboarded is nobody's business outside the agency. assignment is set only on GET .../leads/{lead}/assignees, where the two extra fiel",
        "properties": {
          "object": {
            "const": "member"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": "string"
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "user"
            ]
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "assignable": {
            "type": "boolean"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "assignment_source": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ]
          },
          "assigned_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "email",
          "avatar_url",
          "role",
          "timezone",
          "active",
          "assignable",
          "created_at"
        ]
      },
      "lead": {
        "type": "object",
        "description": "A lead is a GROUP of reply rows, collapsed to its newest with a DISTINCT ON over (client_id, eb_lead_id), and that pair carries no unique constraint anywhere in the database. So id is a signed pair and the caller has already built it with encodeLeadId(clientId, ebLeadId). responded, unread, has_open_task and next_due_at are computed by the caller because three of them are key-scoped: they are resolved for the key's OWNER, so two keys held by two people report different values for the same lead. responded is team-wide instead. The determinism class in the docs is the honest signal; this functio",
        "properties": {
          "object": {
            "const": "lead"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {},
          "classification": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {},
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "body_preview": {
            "type": [
              "string",
              "null"
            ]
          },
          "latest_reply_id": {
            "type": "string"
          },
          "last_message_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_message_direction": {
            "type": "string"
          },
          "last_action_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "booked_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "disqualified_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "meeting_outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "meeting_outcome_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "responded": {
            "type": "boolean"
          },
          "unread": {
            "type": "boolean"
          },
          "campaign_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "campaign_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "assignee_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "has_open_task": {
            "type": "boolean"
          },
          "next_due_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "indexed_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "assignees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/member"
            },
            "description": "Expansions, each present only when requested."
          },
          "campaign": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/campaign"
              },
              {
                "type": "null"
              }
            ]
          },
          "open_tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/task"
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/note"
            }
          },
          "meetings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/meeting"
            }
          },
          "sdr_notes": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "email",
          "first_name",
          "last_name",
          "company_name",
          "title",
          "status",
          "classification",
          "state",
          "subject",
          "body_preview",
          "latest_reply_id",
          "last_message_at",
          "last_message_direction",
          "last_action_at",
          "booked_at",
          "disqualified_at",
          "meeting_outcome",
          "meeting_outcome_at",
          "responded",
          "unread",
          "campaign_id",
          "campaign_name",
          "assignee_ids",
          "has_open_task",
          "next_due_at",
          "indexed_at"
        ]
      },
      "reply": {
        "type": "object",
        "description": "One indexed inbound email, the atomic unit responses_index is keyed on. The full conversation lives at /messages. status is the raw per-reply last_action, lowercased the same way as a lead's but nullable here, because at the reply level \"no tag\" is genuinely absent rather than the untagged lifecycle state.",
        "properties": {
          "object": {
            "const": "reply"
          },
          "id": {
            "type": "string"
          },
          "lead_id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "body_preview": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "classification": {
            "type": [
              "string",
              "null"
            ]
          },
          "direction": {
            "type": "string"
          },
          "received_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "campaign_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "campaign_name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "lead_id",
          "workspace",
          "email",
          "subject",
          "body_preview",
          "status",
          "classification",
          "direction",
          "received_at",
          "campaign_id",
          "campaign_name"
        ]
      },
      "attachment": {
        "type": "object",
        "description": "A filename and an opaque id. That is the whole object. ReplyAttachment is { id, uuid?, file_name, download_url }. There is no size and no content type in EmailBison's payload, so neither is invented. download_url is withheld: it is a signed EmailBison link whose signature covers the exact path, which makes it a bearer capability, and handing one to a third-party integration gives that integration the file. Downloading needs a proxied endpoint with its own auth, which is v3.",
        "properties": {
          "object": {
            "const": "attachment"
          },
          "id": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "filename"
        ]
      },
      "message": {
        "type": "object",
        "description": "One message in a lead's merged timeline. kind comes from the sign of the raw id. buildLeadThreadMessages synthesizes a campaign send as -e.id so it cannot collide with a real reply id during dedupe, which makes the sign the only marker of provenance. The negative integer itself is never surfaced. direction and sent_at are delegated to thread-direction.ts and must not be reimplemented. That module exists to kill two live bugs: matching the sender against the stored lead email mislabels a lead who replies from a different address, and EmailBison's date_received on an OUTGOING message is a delive",
        "properties": {
          "object": {
            "const": "message"
          },
          "id": {
            "type": "string"
          },
          "lead_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "reply",
              "campaign_send"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "reply_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "from_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "from_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "to_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "body_html": {
            "type": [
              "string",
              "null"
            ]
          },
          "body_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "sent_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/attachment"
            }
          }
        },
        "required": [
          "object",
          "id",
          "lead_id",
          "kind",
          "direction",
          "reply_id",
          "subject",
          "from_name",
          "from_email",
          "to_email",
          "body_html",
          "body_text",
          "sent_at",
          "attachments"
        ]
      },
      "note": {
        "type": "object",
        "description": "lead_notes.client_id is notNull() with NO foreign key, so a wrong tenant id is representable in that column. The read path therefore filters client_id AND joins responses_index through response_id, and workspace here is the slug that survived both. Neither raw column is on the wire.",
        "properties": {
          "object": {
            "const": "note"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "lead_id": {
            "type": "string"
          },
          "reply_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": [
              "string",
              "null"
            ]
          },
          "author_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "lead_id",
          "reply_id",
          "body",
          "author_id",
          "created_at",
          "updated_at"
        ]
      },
      "task_sequence": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "step_index": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "step_index"
        ]
      },
      "task": {
        "type": "object",
        "description": "Four columns this object claims do not exist on tasks, and each absence is load-bearing. There is no client_id. The tenant is derived through response_id -> responses_index.client_id, and every query adds isNotNull(response_id) because response_id is nullable so a task can hang off a dead CRM company_id instead. Those rows have no lead, no reply and no derivable workspace, so they are invisible to the API. That is also why reply_id here is non-null. There is no status. Open is completed_at IS NULL AND deleted_at IS NULL. Soft-deleted rows are filtered out of the query and never surface as a st",
        "properties": {
          "object": {
            "const": "task"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "lead_id": {
            "type": "string"
          },
          "reply_id": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "task_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "due_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "completed"
            ]
          },
          "creator_id": {
            "type": "string"
          },
          "assignee_id": {
            "type": "string"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "sequence": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/task_sequence"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "lead_id",
          "reply_id",
          "title",
          "notes",
          "task_type",
          "due_date",
          "due_time",
          "status",
          "creator_id",
          "assignee_id",
          "completed_at",
          "created_at",
          "sequence"
        ]
      },
      "meeting": {
        "type": "object",
        "description": "host_id is assigned_ae_id, the round-robin-picked host whose calendar holds the event. booked_by_id is the operator who ran the booking form, which for a calendar booking is usually not the host. Keeping them apart matters for attribution: insights credit bookings to booked_by_id. custom_fields keys are event_type_form_fields.field_key values. Times can lag a host-side reschedule by up to 15 minutes, because the API read path deliberately skips syncUpcomingMeetingTimes: that helper makes a live Google or Microsoft call per row and writes corrected times back, which is a per-row cost on a per-r",
        "properties": {
          "object": {
            "const": "meeting"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "lead_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "event_type_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string"
          },
          "booked_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "booked_by_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "host_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "starts_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "invitee": {
            "type": "object"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "guests": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "custom_fields": {},
          "utm_params": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "channel": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirmation_status": {
            "type": "string"
          },
          "location": {
            "type": "object"
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "outcome_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "outcome_by_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "locked": {
            "type": "boolean"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "internal_notes": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "lead_id",
          "event_type_id",
          "source",
          "booked_at",
          "booked_by_id",
          "host_id",
          "starts_at",
          "ends_at",
          "timezone",
          "invitee",
          "email",
          "name",
          "company_name",
          "domain",
          "guests",
          "custom_fields",
          "utm_params",
          "channel",
          "confirmation_status",
          "location",
          "outcome",
          "outcome_at",
          "outcome_by_id",
          "locked",
          "created_at"
        ]
      },
      "event_type": {
        "type": "object",
        "description": "slug is notNull().unique() GLOBALLY, across every tenant, which makes it a real cross-tenant collision surface rather than a per-workspace handle. It is published because the public booking URL contains it anyway. default_field_config is stored as {} when the built-in defaults apply, so this resolves it through resolveDefaultFieldConfig and always returns the concrete map. A caller never has to know the empty-object convention. public_url is null when no public origin is configured, rather than a localhost link a caller would send to a prospect. external_id is withheld: it is a provider-side e",
        "properties": {
          "object": {
            "const": "event_type"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "event_name_template": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_minutes": {
            "type": "number"
          },
          "buffer_before_minutes": {
            "type": "number"
          },
          "buffer_after_minutes": {
            "type": "number"
          },
          "scheduling_type": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          },
          "public_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "public_booking_window_days": {
            "type": "number"
          },
          "minimum_notice_minutes": {
            "type": "number"
          },
          "business_emails_only": {
            "type": "boolean"
          },
          "redirect_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "workspace_wide": {
            "type": "boolean"
          },
          "active": {
            "type": "boolean"
          },
          "requires_confirmation": {
            "type": "boolean"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "order_index": {
            "type": "number"
          },
          "use_event_type_availability": {
            "type": "boolean"
          },
          "default_field_config": {},
          "booking_provider": {
            "type": "string"
          },
          "created_by_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "hosts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/event_type_host"
            }
          },
          "form_fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/event_type_form_field"
            }
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "name",
          "slug",
          "description",
          "event_name_template",
          "duration_minutes",
          "buffer_before_minutes",
          "buffer_after_minutes",
          "scheduling_type",
          "public",
          "public_url",
          "public_booking_window_days",
          "minimum_notice_minutes",
          "business_emails_only",
          "redirect_url",
          "workspace_wide",
          "active",
          "requires_confirmation",
          "type",
          "phone",
          "description",
          "order_index",
          "use_event_type_availability",
          "default_field_config",
          "booking_provider",
          "created_by_id",
          "created_at",
          "updated_at"
        ]
      },
      "event_type_host": {
        "type": "object",
        "description": "member_id is the opaque form of event_type_hosts.user_id.",
        "properties": {
          "object": {
            "const": "event_type_host"
          },
          "id": {
            "type": "string"
          },
          "event_type_id": {
            "type": "string"
          },
          "member_id": {
            "type": "string"
          },
          "weight": {
            "type": "number"
          },
          "priority": {
            "type": "number"
          },
          "is_host": {
            "type": "boolean"
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "event_type_id",
          "member_id",
          "weight",
          "priority",
          "is_host",
          "active"
        ]
      },
      "event_type_form_field": {
        "type": "object",
        "properties": {
          "object": {
            "const": "event_type_form_field"
          },
          "id": {
            "type": "string"
          },
          "event_type_id": {
            "type": "string"
          },
          "field_key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "required": {
            "type": "boolean"
          },
          "order_index": {
            "type": "number"
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "event_type_id",
          "field_key",
          "label",
          "type",
          "options",
          "required",
          "order_index",
          "active"
        ]
      },
      "slot": {
        "type": "object",
        "description": "A start and an end, and nothing else, deliberately. No host identity on a slot, so a caller cannot enumerate who on the team is free when, which is private calendar information about a person rather than a fact about the workspace.",
        "properties": {
          "object": {
            "const": "slot"
          },
          "start": {
            "type": [
              "string",
              "null"
            ]
          },
          "end": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "start",
          "end"
        ]
      },
      "availability": {
        "type": "object",
        "description": "reason carries a short cause when slots is empty and the cause is knowable (outside_booking_window, no_active_hosts, no_calendar_connected), so a caller can tell \"nothing free\" from \"misconfigured\". Raw calendar busy blocks are never returned. They are the host's private calendar, and the free slots are the only part that is the caller's business.",
        "properties": {
          "object": {
            "const": "availability"
          },
          "event_type_id": {
            "type": "string"
          },
          "duration_minutes": {
            "type": "number"
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "window": {
            "type": "object"
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/slot"
            }
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "event_type_id",
          "duration_minutes",
          "timezone",
          "window",
          "slots",
          "reason"
        ]
      },
      "template": {
        "type": "object",
        "description": "body is the RAW template, unresolved {{tokens}} and all. Never send it as an email: POST .../templates/{id}/render exists for exactly that, and it is the single most likely way an agent damages a client. scope exists because of a real cross-tenant quirk. visibleWhere in the templates route returns every row with visibility = \"global\" from ANY workspace, with no client_id bound on that branch, so a list under one workspace legitimately contains rows owned by another. Rather than hide that, scope names it and a global template reports workspace: null, which keeps the nested-path invariant from b",
        "properties": {
          "object": {
            "const": "template"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": [
              "string",
              "null"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "workspace",
              "global"
            ]
          },
          "name": {
            "type": "string"
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string"
          },
          "is_html": {
            "type": "boolean"
          },
          "visibility": {
            "type": "string"
          },
          "folder_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "order_index": {
            "type": "number"
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ai_variables": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "created_by_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "scope",
          "name",
          "subject",
          "body",
          "is_html",
          "visibility",
          "folder_id",
          "order_index",
          "variables",
          "ai_variables",
          "created_by_id",
          "created_at"
        ]
      },
      "template_folder": {
        "type": "object",
        "properties": {
          "object": {
            "const": "template_folder"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sort_order": {
            "type": "number"
          },
          "template_count": {
            "type": "number"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "name",
          "sort_order",
          "template_count",
          "created_at"
        ]
      },
      "asset": {
        "type": "object",
        "description": "url carries the link for loom, doc and link; body carries the snippet for text and is null otherwise. client_assets.visibility has only TWO values, private and workspace. There is no global, unlike reply_templates.visibility and followup_sequences.visibility, which have three. An agent that learned visibility on templates and sends global here gets a 422, and GET /v1/capabilities calls the difference out. Rows with visibility: \"private\" are filtered to the key's owner in the query, not here.",
        "properties": {
          "object": {
            "const": "asset"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility": {
            "type": "string"
          },
          "order_index": {
            "type": "number"
          },
          "created_by_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "kind",
          "title",
          "url",
          "body",
          "visibility",
          "order_index",
          "created_by_id",
          "created_at"
        ]
      },
      "sequence": {
        "type": "object",
        "description": "Both forms of the sending window are returned. send_days is readable and send_days_mask is the value a write would have to send back, and the docs say the basis is UTC: a sequence set to weekdays fires on UTC weekdays, not the rep's. followup_sequences.deleted_at is withheld and soft-deleted rows are filtered out of the query, so a caller never sees a tombstone.",
        "properties": {
          "object": {
            "const": "sequence"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "visibility": {
            "type": "string"
          },
          "send_days": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "send_days_mask": {
            "type": "number"
          },
          "created_by_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/sequence_step"
            }
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "name",
          "active",
          "visibility",
          "send_days",
          "send_days_mask",
          "created_by_id",
          "created_at"
        ]
      },
      "sequence_step": {
        "type": "object",
        "description": "wait_for_previous is the column wait_for_prev, spelled out on the wire.",
        "properties": {
          "object": {
            "const": "sequence_step"
          },
          "id": {
            "type": "string"
          },
          "order_index": {
            "type": "number"
          },
          "type": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "delay_value": {
            "type": "number"
          },
          "delay_unit": {
            "type": "string"
          },
          "wait_for_previous": {
            "type": "boolean"
          },
          "template_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "email_body": {
            "type": [
              "string",
              "null"
            ]
          },
          "linkedin_text": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "order_index",
          "type",
          "title",
          "delay_value",
          "delay_unit",
          "wait_for_previous",
          "template_id",
          "email_body",
          "linkedin_text"
        ]
      },
      "enrollment": {
        "type": "object",
        "description": "followup_enrollments.client_id is notNull with NO foreign key, so the read path filters it and ALSO joins responses_index through response_id, which does carry a cascading foreign key. The raw column is withheld.",
        "properties": {
          "object": {
            "const": "enrollment"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "sequence_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "lead_id": {
            "type": "string"
          },
          "reply_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "next_step_index": {
            "type": "number"
          },
          "enrolled_by_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "sequence_id",
          "lead_id",
          "reply_id",
          "status",
          "next_step_index",
          "enrolled_by_id",
          "created_at"
        ]
      },
      "campaign_tag": {
        "type": "object",
        "description": "These ids are the match key for assignment_rules.tag_ids and sdr_note_sets.tag_ids, both matched by Postgres array overlap.",
        "properties": {
          "object": {
            "const": "campaign_tag"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "campaign_count": {
            "type": "number"
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "name",
          "campaign_count"
        ]
      },
      "campaign": {
        "type": "object",
        "description": "Proxied live from EmailBison with the per-workspace token from clients.eb_token. That token is stored in PLAIN TEXT, which is exactly why this is a hand-written five-field mapper and never a spread of an upstream response: no field EmailBison invents tomorrow can arrive on the wire by accident, and the token cannot ride along in a response, an error or a log. The tags here are the inline { id, name } form, not full campaign_tag objects, so a campaign row does not carry a count nobody asked for.",
        "properties": {
          "object": {
            "const": "campaign"
          },
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "object",
          "id",
          "workspace",
          "name",
          "status",
          "tags"
        ]
      },
      "rep_stat": {
        "type": "object",
        "description": "RepStat.image is dropped: an avatar URL belongs on a member, and repeating it in an aggregate invites a caller to build a directory out of a report. The booking-rate inputs are approximate and the docs say so. Interested is attributed through action_log and booked through scheduled_meetings.booked_by_id, and those two can disagree for the same rep.",
        "properties": {
          "member_id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meetings_booked": {
            "type": "number"
          },
          "showed_meetings": {
            "type": "number"
          },
          "meetings_with_outcome": {
            "type": "number"
          },
          "show_rate": {
            "type": "number"
          },
          "interested_leads": {
            "type": "number"
          },
          "booked_from_interested": {
            "type": "number"
          },
          "booking_rate": {
            "type": "number"
          },
          "first_response_avg_sec": {
            "type": "number"
          },
          "first_response_count": {
            "type": "number"
          },
          "followup_avg_sec": {
            "type": "number"
          },
          "followup_count": {
            "type": "number"
          }
        },
        "required": [
          "member_id",
          "name",
          "meetings_booked",
          "showed_meetings",
          "meetings_with_outcome",
          "show_rate",
          "interested_leads",
          "booked_from_interested",
          "booking_rate",
          "first_response_avg_sec",
          "first_response_count",
          "followup_avg_sec",
          "followup_count"
        ]
      },
      "speed_bucket": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "n": {
            "type": "number"
          },
          "booked": {
            "type": "number"
          },
          "showed": {
            "type": "number"
          },
          "booking_rate": {
            "type": "number"
          },
          "show_rate": {
            "type": "number"
          }
        },
        "required": [
          "label",
          "n",
          "booked",
          "showed",
          "booking_rate",
          "show_rate"
        ]
      },
      "insights_summary": {
        "type": "object",
        "description": "EVERY RATE IS A RATIO IN [0,1], never a percentage. A caller that multiplies by 100 twice is a documentation failure, and the way to avoid it is to never ship a percent. meetingsTimeline and bookingTimeline are NOT included. Both are fixed \"last 12 ISO weeks\" series that ignore the requested window, so returning them next to a windowed funnel would put two different time ranges in one object. GET /insights/daily is the windowed series. speed_to_lead is deploy-forward only: lead_response_times rows exist from the day the feature shipped, so a window reaching earlier under-counts. generated_at i",
        "properties": {
          "object": {
            "const": "insights_summary"
          },
          "workspace": {
            "type": "string"
          },
          "window": {
            "type": "object"
          },
          "all_responses": {
            "type": "number"
          },
          "positive_responses": {
            "type": "number"
          },
          "booked_meetings": {
            "type": "number"
          },
          "showed_meetings": {
            "type": "number"
          },
          "total_meetings_booked": {
            "type": "number"
          },
          "meetings_with_outcome": {
            "type": "number"
          },
          "show_rate": {
            "type": "number"
          },
          "total_interested_leads": {
            "type": "number"
          },
          "booked_interested_leads": {
            "type": "number"
          },
          "booking_rate": {
            "type": "number"
          },
          "first_response_avg_sec": {
            "type": "number"
          },
          "first_response_count": {
            "type": "number"
          },
          "followup_avg_sec": {
            "type": "number"
          },
          "followup_count": {
            "type": "number"
          },
          "per_rep": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/rep_stat"
            }
          },
          "speed_buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/speed_bucket"
            }
          },
          "generated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "workspace",
          "window",
          "all_responses",
          "positive_responses",
          "booked_meetings",
          "showed_meetings",
          "total_meetings_booked",
          "meetings_with_outcome",
          "show_rate",
          "total_interested_leads",
          "booked_interested_leads",
          "booking_rate",
          "first_response_avg_sec",
          "first_response_count",
          "followup_avg_sec",
          "followup_count",
          "per_rep",
          "speed_buckets",
          "generated_at"
        ]
      },
      "campaign_step": {
        "type": "object",
        "description": "step_id is EbSequenceStepStat.sequence_step_id, a CADENCE step id, and it is the one raw upstream integer in the whole API. It is published because a caller comparing two runs needs to line the rows up, and it is not sensitive: it names a step inside a campaign the caller can already read. It is NOT durable, though. Removing a variant in EmailBison resets per-variant ids and breaks historical metrics, which is a documented production hazard.",
        "properties": {
          "object": {
            "const": "campaign_step"
          },
          "step_id": {
            "type": "number"
          },
          "label": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "sent": {
            "type": "number"
          },
          "contacts": {
            "type": "number"
          },
          "replies": {
            "type": "number"
          },
          "interested": {
            "type": "number"
          }
        },
        "required": [
          "object",
          "step_id",
          "label",
          "subject",
          "sent",
          "contacts",
          "replies",
          "interested"
        ]
      },
      "campaign_insight": {
        "type": "object",
        "description": "The array is steps, not variants, on purpose. They come from EmailBison sequence steps, and the UI's \"Variant A\" labels are preserved, but calling the array variants would invite every consumer to read it as A/B test output. EmailBison stamps a reply with its campaign and not with the variant that produced the sent email, so there is no per-step booked or showed and none is invented. There is no unique_opens. Every campaign ships open_tracking: false, so the number does not exist and a null field would only invite someone to chart it. bounced here is a reporting number, not the deliverability ",
        "properties": {
          "object": {
            "const": "campaign_insight"
          },
          "campaign_id": {
            "type": "string"
          },
          "campaign_name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "emails_sent": {
            "type": "number"
          },
          "contacts": {
            "type": "number"
          },
          "replies": {
            "type": "number"
          },
          "interested": {
            "type": "number"
          },
          "bounced": {
            "type": "number"
          },
          "booked": {
            "type": "number"
          },
          "showed": {
            "type": "number"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/campaign_step"
            }
          }
        },
        "required": [
          "object",
          "campaign_id",
          "campaign_name",
          "status",
          "emails_sent",
          "contacts",
          "replies",
          "interested",
          "bounced",
          "booked",
          "showed",
          "tags",
          "steps"
        ]
      },
      "daily_point": {
        "type": "object",
        "description": "date is a UTC calendar day and the series is DENSE: a day with no activity comes back as zeros rather than being omitted, so a caller can chart it without gap-filling.",
        "properties": {
          "object": {
            "const": "daily_point"
          },
          "date": {
            "type": "string"
          },
          "emails_sent": {
            "type": "number"
          },
          "responses": {
            "type": "number"
          },
          "positive_responses": {
            "type": "number"
          },
          "booked": {
            "type": "number"
          }
        },
        "required": [
          "object",
          "date",
          "emails_sent",
          "responses",
          "positive_responses",
          "booked"
        ]
      },
      "error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "invalid_cursor",
                  "invalid_id",
                  "unsupported_filter",
                  "unsupported_sort",
                  "missing_authorization",
                  "malformed_key",
                  "invalid_key",
                  "key_revoked",
                  "key_expired",
                  "owner_deactivated",
                  "insufficient_scope",
                  "workspace_forbidden",
                  "test_keys_unsupported",
                  "not_found",
                  "conflict",
                  "unprocessable",
                  "rate_limited",
                  "too_many_concurrent",
                  "internal_error",
                  "upstream_error"
                ]
              },
              "message": {
                "type": "string"
              },
              "param": {
                "type": "string"
              },
              "required_scope": {
                "type": "string",
                "enum": [
                  "workspaces:read",
                  "members:read",
                  "leads:read",
                  "leads:write",
                  "threads:read",
                  "notes:read",
                  "notes:write",
                  "tasks:read",
                  "tasks:write",
                  "meetings:read",
                  "meetings:write",
                  "event_types:read",
                  "templates:read",
                  "assets:read",
                  "sequences:read",
                  "campaigns:read",
                  "insights:read"
                ]
              },
              "retry_after": {
                "type": "integer"
              }
            }
          }
        }
      }
    }
  }
}
