{
  "openapi": "3.2.0",
  "info": {
    "title": "Sales API",
    "description": "The Sales REST API: the lead capture and outreach tracking of an Account. It manages the Account's Forms, Campaigns, and Prospects, reads and deletes the Leads the Forms collect, and hands work to the Account's Assistant. Every call acts as exactly one User, in the one Account the credential is in now, with that User's full power.\n\nSign in with one of two credentials, sent as `Authorization: Bearer <credential>`:\n\n- **Agent connection** (`agentConnection`): OAuth 2 authorization code with PKCE at Auth, for the resource `https://demo.mvdm.io/sales/api`.\n- **Personal token** (`personalToken`): a `mvdm_pat_…` token a User creates on Auth.\n\nBoth are managed on [API & Agent Access](https://auth.mvdm.io/User/AgentAccess). Every error is ProblemDetails (RFC 9457) with a stable `type` token. v1 only grows: a breaking change ships as `/api/v2/` beside it.\n\nLeads arrive only through a Form's sign-up endpoint, which a website posts to from the Form's snippet, so this API has no Lead create.\n\nFor a walk-through, read [the REST guide](https://demo.mvdm.io/sales/agents/rest); to connect an Agent or the CLI, see [the setup guides](https://demo.mvdm.io/sales/agents).",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://demo.mvdm.io/sales"
    }
  ],
  "paths": {
    "/api/v1/campaigns": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "List Campaigns",
        "description": "Lists the Account's Campaigns as the Campaigns page does: newest first, then by `id`. Takes `$filter`, `$select`, `$orderby`, `$top` (default 50, at most 200), and `$skip`; `$expand` is refused. The one filter term is `contains(name, '<text>')`, which keeps the Campaigns whose name contains the text, ignoring case; write a quote inside the text twice (`''`). The sort keys are `name`, `createdAt`, and `id`, each with an optional `asc` or `desc`. Every row carries `id`, `url` (the Campaign's page), `name`, `prospectCount`, `followUpDueCount` (the Prospects that are Follow-up due today, counted in each Prospect's time zone, or the time zone of your Sales account member, or UTC when it has none, for a Prospect with an Unknown one, skipping weekends and public holidays where the Prospect is), and `createdAt`; `$select` narrows them and always keeps `id`. `nextOffset` is the `$skip` for the next page, or null on the last one. An unknown field or term, or a value outside its range, answers 422 on that parameter.",
        "operationId": "campaigns.list",
        "parameters": [
          {
            "name": "$filter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$select",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$orderby",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$expand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "$skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiListOfApiCampaignItem"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Create a Campaign",
        "description": "Stores a Campaign with its Statuses as the New Campaign page does. `name` is required, at most 100 characters. Give at most one way to start the Statuses: `template` (`cold-email` or `simple`, named in the language of your Sales account), `copyStatusesFromCampaignId` (the Statuses of one of the Account's Campaigns, which answers 404 when it is not one), or an explicit `statuses` list of `name`, `followUpAfterWorkingDays` (1 to 60, or left out), and `isFinal`. Left out, the Campaign starts from Cold email; giving more than one is a 422. A Status name is required, unique in the Campaign in any letter case, and not the name of an import column; a final Status has no follow-up. A refusal answers 422 on its field, and nothing is stored. Answers 201 with the new Campaign and its address in `Location`.",
        "operationId": "campaigns.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCampaignCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCampaignCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCampaignCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCampaign"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/campaigns/{id}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Get a Campaign",
        "description": "Returns the Campaign with its Statuses in order. Each Status carries `id`, `name`, `position` (from 1), `followUpAfterWorkingDays` (null for none), `isFinal`, and `prospectCount`; the Campaign carries its own `prospectCount` and `followUpDueCount`, the Prospects that are Follow-up due today, counted in each Prospect's time zone, or the time zone of your Sales account member, or UTC when it has none, for a Prospect with an Unknown one, skipping weekends and public holidays where the Prospect is.",
        "operationId": "campaigns.get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCampaign"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "patch": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Change a Campaign",
        "description": "Changes the fields you send and keeps the rest, as the Campaign's settings page does. Neither field can be cleared: `null` answers 422 on that field. `statuses` is the whole ordered list: a row with the `id` of one of the Campaign's Statuses keeps that Status and takes the new `name`, `followUpAfterWorkingDays` (1 to 60, or left out for none) and `isFinal`; a row without `id` adds a Status; a Status left out is removed; the list is numbered 1 to n in the order you send. An `id` that is not a Status of this Campaign, or one used twice, answers 422 on that row. A Status name is required, unique in the Campaign in any letter case, and not the name of an import column; a final Status has no follow-up. Left out, `statuses` stay as they are. Nothing is stored when a field is refused. Answers the changed Campaign.",
        "operationId": "campaigns.update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCampaignUpdate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCampaignUpdate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCampaignUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCampaign"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Delete a Campaign",
        "description": "Permanently deletes the Campaign together with its Statuses and all its Prospects, as the Campaign settings page's delete does. There is no preview and no confirm step: the call deletes, so show the Campaign and its `prospectCount` to the user first. Answers 204 with no body.",
        "operationId": "campaigns.delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/campaigns/{id}/import-prospects": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Import Prospects into a Campaign",
        "description": "Imports the Prospects of a CSV (UTF-8) or Excel (`.xlsx`) file, sent as the multipart field `file`, as the Campaign's Import page does: all of the file or none of it. The first row is the header: `Email` and `Email source` are required columns; `Name`, `Role`, `Organisation`, `Why it fits`, `Notes`, `History note`, `History note date`, `Tags` (Tags separated by commas, at most 50 characters each), `Time zone` (an IANA name such as `America/New_York`, empty for Unknown; `Tijdzone` in Dutch), `Email sent`, `Email subject`, `Message-ID`, `Email bounced`, and `Status` (the name of one of the Campaign's Statuses; left empty, the first Status) are optional, in English or Dutch and in any order and letter case. Add one column per Status of the Campaign, named exactly as the Status, to give the date (`YYYY-MM-DD`, not after today in the time zone of your Sales account member, or UTC when it has none) the Prospect reached it; `Campaign` and `Last change` columns are ignored, so an export imports again. Blank rows are left out. A `History note` column adds that row's text to the History of the Prospect with the row's email, and `History note date` dates it: `YYYY-MM-DD` or `YYYY-MM-DD HH:MM`, a time read in the time zone of your Sales account member (UTC when it has none), a date alone at 12:00 UTC, an empty date the moment of the import, and not after now. One note per row: repeat the row for each note. The note reaches that Prospect in any Campaign, also when the row is skipped as a Prospect, and is not added again when the Prospect has a note with the same text and date (an empty date: the same text at any time). `Email sent`, `Email subject`, `Message-ID`, and `Email bounced` record a Sent email, and a Bounce on it, in the History of the Prospect with the row's email, in any Campaign, also when the row is skipped and also for a Prospect in a final Status. A row holds at most one Sent email: `Email subject` is required when any of the four has a value (at most 500 characters, as is `Message-ID`); `Email sent` and `Email bounced` take `YYYY-MM-DD`, `YYYY-MM-DD HH:MM` (a time read in the time zone of your Sales account member, UTC when it has none) or a typed Excel date, a date alone at 12:00 UTC, neither after now, and an empty `Email sent` is the moment of the import; `Email bounced` cannot come before `Email sent`. Repeat the row for each email. A Sent email is not added again when the Prospect has one with the same `Message-ID`; without a `Message-ID`, one without a `Message-ID` with the same subject at the same minute (an empty `Email sent`: the same subject at any time). A row that repeats a Sent email adds its Bounce when that Sent email has none, and otherwise skips the Bounce without refusing the row. `Last email` is ignored. A row whose email is a Prospect of the Account already, in any Campaign, or repeats an earlier row, is skipped and counted in `skipped`, and is never refused as Blocked. A row that would be Blocked, because a Prospect in a final Status, in the Account or in another row of the file, has an address at the same email domain (a free-mail domain such as gmail.com never matches) or the same organisation, is a wrong row; a row in a final Status is never refused by this rule. At most 5,000 rows and 5 MB. A wrong file or row answers 422 on `file` with one sentence per problem, naming each wrong row by its number (the header is row 1), and nothing is stored; `blockedRows` lists `{ row, blockedBy }` for each row blocked by a Prospect already in the Account, with that Prospect as in `prospects.get`, and a row blocked by another row of the file has no entry there. Answers `imported`, `skipped`, `notesAdded` (the notes added to History, 0 when none), `sentEmailsAdded`, and `bouncesAdded` (the Sent emails and Bounces added, 0 when none).",
        "operationId": "campaigns.import-prospects",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProspectImport"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/forms/{id}/email-settings/me": {
      "get": {
        "tags": [
          "Email settings"
        ],
        "summary": "Get my Email me new Leads switch",
        "description": "Returns whether you get an email for each new Lead of the Form, as the Form's email page shows it. It is your own switch: other members have theirs.",
        "operationId": "email-settings.get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFormEmailSettings"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "patch": {
        "tags": [
          "Email settings"
        ],
        "summary": "Set my Email me new Leads switch",
        "description": "Turns your own Email me new Leads switch for the Form on or off with `newLead`, as the Form's email page does. Other members' switches stay. An empty body changes nothing. Answers the switch as stored.",
        "operationId": "email-settings.update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFormEmailSettingsUpdate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFormEmailSettingsUpdate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFormEmailSettingsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFormEmailSettings"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/forms": {
      "get": {
        "tags": [
          "Forms"
        ],
        "summary": "List Forms",
        "description": "Lists the Account's Forms as the Forms page does: by name, then by `id`. Takes `$filter`, `$select`, `$orderby`, `$top` (default 50, at most 200), and `$skip`; `$expand` is refused. The one filter term is `contains(name, '<text>')`, which keeps the Forms whose name contains the text, ignoring case; write a quote inside the text twice (`''`). The sort keys are `name`, `createdAt`, and `id`, each with an optional `asc` or `desc`. Every row carries `id`, `url` (the Form's page), `name`, `domains`, `privacyUrl` (null while the Form has no privacy notice link), `buttonLabel`, `thankYouText`, `downloadUrl` (null while the Form has no Download link), `askName`, `askCompany`, `consentText`, `consentVersion`, `leadCount`, `latestSignUpAt` (null while the Form has no Lead), and `createdAt`; `$select` narrows them and always keeps `id`. `nextOffset` is the `$skip` for the next page, or null on the last one. An unknown field or term, or a value outside its range, answers 422 on that parameter.",
        "operationId": "forms.list",
        "parameters": [
          {
            "name": "$filter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$select",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$orderby",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$expand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "$skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiListOfApiFormItem"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "post": {
        "tags": [
          "Forms"
        ],
        "summary": "Create a Form",
        "description": "Stores a Form as the New Form page does. `name` is required; a missing or blank one answers 422 on that field. `privacyUrl` is the link to your own privacy notice, `https` or a `localhost` address; left out, the Form has no link, takes no sign-ups, and has no snippet until you add it. `domains` are the hostnames the Form accepts sign-ups from, and `localhost` for a page on your own computer; left out, the Form accepts none. `buttonLabel`, `thankYouText`, and `consentText` left out take Sales' own text in the language of your Sales account; one you send blank is refused. `downloadUrl` is the web address of the free resource people get after they sign up, `https` or a `localhost` address; left out, the Form has no Download link. `askName` and `askCompany` left out are false. The member who calls starts with Email me new Leads on for the Form. Nothing is stored when a field is refused. Answers 201 with the new Form and its address in `Location`.",
        "operationId": "forms.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFormCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFormCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFormCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiForm"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/forms/{id}": {
      "get": {
        "tags": [
          "Forms"
        ],
        "summary": "Get a Form",
        "description": "Returns the Form with every field the list rows hold.",
        "operationId": "forms.get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiForm"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "patch": {
        "tags": [
          "Forms"
        ],
        "summary": "Change a Form",
        "description": "Changes the fields you send and keeps the rest, as the Form's settings page does. `downloadUrl` and `privacyUrl` can be cleared: `null` or an empty text removes the Download link or the privacy notice link, and a Form without the privacy notice link takes no sign-ups and has no snippet. On every other field `null` answers 422, and so does a blank text. `domains` replaces the whole list. A `consentText` that differs from the current one gives the Form its next `consentVersion`; Leads already collected keep the text they ticked. Nothing is stored when a field is refused. Answers the changed Form.",
        "operationId": "forms.update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFormUpdate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFormUpdate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFormUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiForm"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Forms"
        ],
        "summary": "Delete a Form",
        "description": "Permanently deletes the Form together with all its Leads, its consent texts, and every member's Email me new Leads switch for it, as the Form page's delete does. A snippet already on a website then stops collecting. There is no preview and no confirm step: the call deletes, so show the Form to the user first. Answers 204 with no body.",
        "operationId": "forms.delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/forms/{id}/snippet": {
      "get": {
        "tags": [
          "Forms"
        ],
        "summary": "Get a Form's snippet",
        "description": "Returns the HTML to paste into the website so the Form collects Leads: the same snippet the Form's page shows, labelled in the language of your Sales account. A Form without a `privacyUrl` has no snippet: the call answers 409.",
        "operationId": "forms.snippet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFormSnippet"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "409": {
            "description": "`conflict`: The act clashes with the record's state.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "conflict"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/leads": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "List Leads",
        "description": "Lists the Account's Leads as the Leads page does: first sign-up newest first, then the highest `id` first. Takes `$filter`, `$select`, `$orderby`, `$top` (default 50, at most 200), and `$skip`; `$expand` is refused. The filter terms are `formId eq <number>`, `firstSignedUpAt ge <instant>`, and `firstSignedUpAt lt <instant>`, joined with `and`, each at most once. An instant is ISO 8601 and ends in `Z`; `ge` counts the instant and `lt` does not. A `formId` that is not one of the Account's Forms gives an empty list. The sort keys are `firstSignedUpAt`, `lastSignedUpAt`, `email`, and `id`, each with an optional `asc` or `desc`. Every row carries `id`, `url` (the Lead's page), `formId`, `formName`, `email`, `name`, `company`, `pageUrl`, `utmSource`, `utmMedium`, `utmCampaign`, `utmContent`, `consentVersion`, `consentText`, `firstSignedUpAt`, and `lastSignedUpAt`; `$select` narrows them and always keeps `id`. `nextOffset` is the `$skip` for the next page, or null on the last one. An unknown field or term, or a value outside its range, answers 422 on that parameter.",
        "operationId": "leads.list",
        "parameters": [
          {
            "name": "$filter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$select",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$orderby",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$expand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "$skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiListOfApiLeadItem"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/leads/{id}": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "Get a Lead",
        "description": "Returns the Lead with every field the list rows hold, including `consentText`, the text the person ticked at their latest sign-up.",
        "operationId": "leads.get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiLead"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Leads"
        ],
        "summary": "Delete a Lead",
        "description": "Permanently deletes the Lead, as the Lead page's delete does. The person is gone from Sales at once. There is no preview and no confirm step: the call deletes, so show the person's Lead to the user first. Answers 204 with no body.",
        "operationId": "leads.delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/leads/{id}/prospect": {
      "post": {
        "tags": [
          "Leads"
        ],
        "summary": "Add a Lead to a Campaign",
        "description": "Makes the Lead a Prospect of the Campaign `campaignId`, as the Lead page's Add to Campaign does: the Prospect has the Lead's email, name, and company as `organisation`, starts in the Campaign's first Status, and gets an `emailSource` that names the Form, the day of the first sign-up in the time zone of your Sales account member (or UTC when it has none), and the page, in the language of your Sales account member. A Lead whose email address already is a Prospect of the Account, in any Campaign, answers 422 on `email` and names the Campaign that holds it; nothing is stored. A Lead whose email domain (a free-mail domain such as gmail.com never matches) or organisation (the Lead's company) is that of a Prospect of the Account in a final Status would make the Prospect Blocked: it answers 422 on `email` (domain) or `organisation` with that Prospect in `blockedBy`; nothing is stored. An unknown Lead or Campaign answers 404. The Lead stays. Answers 201 with the new Prospect and its address in `Location`.",
        "operationId": "leads.add-to-campaign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiLeadAddToCampaign"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiLeadAddToCampaign"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiLeadAddToCampaign"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProspect"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/legal-acceptance": {
      "post": {
        "tags": [
          "Legal Acceptance"
        ],
        "summary": "Hand Legal Acceptance off to the browser",
        "description": "Legal Acceptance is a person's act, so this always answers 403 `browser-handoff`: show the person `handoffUrl`, where they accept the terms in the browser. Until they do, every call except the Account list and switch answers the same handoff.",
        "operationId": "legal-acceptance.accept",
        "responses": {
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/prospects": {
      "get": {
        "tags": [
          "Prospects"
        ],
        "summary": "List Prospects",
        "description": "Lists the Account's Prospects as a Campaign page does: latest Status change first, then the highest `id` first. Takes `$filter`, `$select`, `$orderby`, `$top` (default 50, at most 200), and `$skip`; `$expand` is refused. The filter terms are `campaignId eq <number>`, `statusId eq <number>`, `followUpDue eq true`, `blocked eq true`, `lastEmailAt ge <time>`, `lastEmailAt lt <time>`, `search('<text>')`, `tags/any(t: t eq '<tag>')`, and `timeZone eq '<zone>'`, joined with `and`, each at most once except `tags/any`, which may repeat: each one adds a Tag the Prospect must carry, so all of them must match. A Tag is matched ignoring letter case and surrounding spaces; write a quote inside it twice (`''`). `timeZone eq '<zone>'` keeps the Prospects with that time zone, read as `prospects.create` reads it, so `europe/amsterdam` finds `Europe/Amsterdam`; a value that is not a time zone matches nothing. `lastEmailAt` is the time of the Prospect's newest Sent email: `lastEmailAt ge` keeps it at or after the time and `lastEmailAt lt` before it, a time is ISO 8601 (with `Z` or an offset it is taken as given, without one it is read in the time zone of your Sales account member, or in UTC when it has none), and a Prospect without a Sent email never matches. `followUpDue eq true` keeps the Prospects that are Follow-up due, judged on today's date in the Prospect's time zone, or in the time zone of your Sales account member (UTC when it has none) for a Prospect with an Unknown one, skipping weekends and public holidays where the Prospect is. `blocked eq true` keeps the Prospects that are Blocked: not in a final Status themselves, while another Prospect of the Account in a final Status has the same email domain (a free-mail domain such as gmail.com never matches) or the same organisation. `search('<text>')` keeps the Prospects whose email, name, or organisation contains the text, ignoring case; write a quote inside the text twice (`''`). An id that is not one of the Account's gives an empty list. The sort keys are `statusChangedAt`, `email`, `createdAt`, `lastEmailAt` (Prospects without one come last, ascending and descending), and `id`, each with an optional `asc` or `desc`. Every row carries what `prospects.get` carries without `history` and `leadIds`: `id`, `url` (the Prospect's page), `campaignId`, `campaignName`, `statusId`, `statusName`, `statusIsFinal`, `email`, `name`, `role`, `organisation`, `emailSource`, `whyItFits`, `notes`, `tags` (the Tag names, alphabetical ignoring letter case), `timeZone` (an IANA name, or null for Unknown), `statusChangedAt`, `createdAt`, `lastEmailAt`, `followUpDue`, and `blockedBy`; `$select` narrows them and always keeps `id`. `nextOffset` is the `$skip` for the next page, or null on the last one. An unknown field or term, or a value outside its range, answers 422 on that parameter.",
        "operationId": "prospects.list",
        "parameters": [
          {
            "name": "$filter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$select",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$orderby",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$expand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "$skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiListOfApiProspectItem"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "post": {
        "tags": [
          "Prospects"
        ],
        "summary": "Create a Prospect",
        "description": "Stores a Prospect in the Campaign `campaignId`, in its first Status, as the New Prospect page does, and writes the first entry of its History. `email` is required, a valid address, and unique among all Prospects of the Account in any Campaign and any letter case; one that is taken answers 422 on `email` and names the Campaign that holds it. A Prospect that would be Blocked is refused the same way: another Prospect of the Account, in any Campaign, in a final Status has an address at the same email domain (a free-mail domain such as gmail.com never matches) or the same `organisation` (letter case and extra spaces ignored, free-mail domains included; an empty one matches nothing), and the answer is 422 on `email` (domain) or `organisation` with the sentence that names that Prospect and its object in `blockedBy` (`id`, `email`, `statusName`, `campaignName`, `match`). A Prospect created in a final Status is never refused by this rule. `emailSource` is required, at most 1000 characters: the public page, and the words on it, that show the address. `tags` (an array of strings) and `timeZone` are optional: a Tag is at most 50 characters after trimming and has no comma, Tags that differ only in letter case or surrounding spaces are one, and a Tag the Account already has keeps its stored spelling; `timeZone` is an IANA name from the list in a member's user settings, matched ignoring letter case, and empty means Unknown. A refused Tag answers 422 on `tags` and an unknown time zone, such as `EST` or a Windows zone name, answers 422 on `timeZone`. A refusal answers 422 on its field, and nothing is stored. Answers 201 with the new Prospect and its address in `Location`.",
        "operationId": "prospects.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProspect"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/prospects/{id}": {
      "get": {
        "tags": [
          "Prospects"
        ],
        "summary": "Get a Prospect",
        "description": "Returns the Prospect with its Campaign and Status (`campaignId`, `campaignName`, `statusId`, `statusName`, `statusIsFinal`), its fields, its `tags` (alphabetical ignoring letter case) and `timeZone` (an IANA name such as `Europe/Amsterdam`, or null for Unknown), `statusChangedAt`, `lastEmailAt` (the UTC time of its newest Sent email, null when it has none), `followUpDue` (true when its Status has a follow-up and the working days have passed, judged on today's date in the Prospect's time zone, or in the time zone of your Sales account member (UTC when it has none) for a Prospect with an Unknown one, skipping weekends and public holidays where the Prospect is; never true for a Blocked Prospect), `blockedBy` (null, or the Prospect that makes this one Blocked: `id`, `email`, `statusName`, `campaignName`, and `match`, `domain` or `organisation`; do not contact a Blocked Prospect), `leadIds` (the ids of the Leads of the Account with the Prospect's email address, first sign-up first), and its `history` newest first. Each history entry carries `id`, `kind` (`status`, `move`, `note`, `email_sent`, or `bounce`), `at`, and the `statusName`, `fromCampaignName`, `toCampaignName`, `note`, `subject`, `messageId`, `sentTo`, `sentEmailId`, and `bounceId` that apply to it; the names are as they were written then. An `email_sent` entry carries `subject`, `messageId`, `sentTo` (the Prospect's address then), and `bounceId` (the id of its `bounce` entry, or null); a `bounce` entry carries `sentEmailId`, the id of the `email_sent` entry that bounced.",
        "operationId": "prospects.get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProspect"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "patch": {
        "tags": [
          "Prospects"
        ],
        "summary": "Change a Prospect",
        "description": "Changes the fields you send and keeps the rest, as the Prospect page's Save does. `email`, `emailSource`, and `campaignId` cannot be cleared: `null` answers 422 on that field. `tags` replaces the Prospect's Tags with the array you send: absent keeps them, and `[]` or `null` clears them; `timeZone` absent keeps the time zone, and `null` or an empty value sets Unknown. A refused Tag or time zone answers 422 on `tags` or `timeZone`, as `prospects.create` does. Moving a Prospect keeps its Tags and time zone, and changing either writes no History entry. `campaignId` moves the Prospect to that Campaign: it gets the Status with the same name there, else the first Status, and the History gets one `move` entry. A Prospect in a final Status keeps its `email` and its Campaign: a change answers 422. An email another Prospect of the Account has answers 422 on `email`. A change of `email` or `organisation` that would make the Prospect Blocked answers 422 on that field with the sentence that names the blocking Prospect and its object in `blockedBy`, as `prospects.create` does; a change that touches neither, such as `notes`, and a Prospect in a final Status are never refused by this rule, and a move to another Campaign is never refused because the Prospect is Blocked. Nothing is stored when a field is refused. Answers the changed Prospect.",
        "operationId": "prospects.update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectUpdate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectUpdate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProspect"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Prospects"
        ],
        "summary": "Delete a Prospect",
        "description": "Permanently deletes the Prospect together with its History, in any Status, as the Prospect page's delete does. There is no preview and no confirm step: the call deletes, so show the Prospect to the user first. Answers 204 with no body.",
        "operationId": "prospects.delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/prospects/set-status": {
      "post": {
        "tags": [
          "Prospects"
        ],
        "summary": "Give Prospects a Status",
        "description": "Gives every Prospect in `prospectIds` the Status `statusId` in one call, writing a `status` entry with the optional `note` in each History. The Status must belong to the Campaign of every Prospect named, or nothing is changed and the answer is 422 on `statusId`. A Prospect in a final Status keeps its Status and is counted in `skippedFinal`; one that has the Status already is counted in neither number. Answers `changed` and `skippedFinal`. An unknown Prospect id answers 404 and changes nothing.",
        "operationId": "prospects.set-status",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectSetStatus"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectSetStatus"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectSetStatus"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProspectStatusChange"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/prospects/{id}/add-note": {
      "post": {
        "tags": [
          "Prospects"
        ],
        "summary": "Add a note to a Prospect",
        "description": "Writes `note` as a `note` entry in the Prospect's History. `note` is required, at most 2000 characters. Answers the Prospect with its History.",
        "operationId": "prospects.add-note",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectNoteCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectNoteCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectNoteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProspect"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/prospects/{id}/record-email-sent": {
      "post": {
        "tags": [
          "Prospects"
        ],
        "summary": "Record an email sent to a Prospect",
        "description": "Writes an `email_sent` entry in the Prospect's History: `subject` (required, at most 500 characters), `sentAt` (an ISO 8601 time such as `2026-11-02T10:00:00Z`; a time without an offset is read in the time zone of your Sales account member, or in UTC when it has none; now when left out; not in the future), the optional `messageId` (at most 500 characters), the optional `note` (at most 2000 characters), and `sentTo`, which is the Prospect's email address. Recording the same email again changes nothing and answers the Prospect: the same `messageId`, or, without one, the same `subject` in the same minute. The optional `statusId` gives the Prospect that Status in the same call, dated at `sentAt`; it must be a Status of the Prospect's Campaign, and a Prospect in a final Status is refused with 422 on `statusId`. A Prospect in a final Status, and a Blocked one, can still record an email when `statusId` is left out. Every refusal answers 422 on its field and stores nothing. Answers the Prospect with its History.",
        "operationId": "prospects.record-email-sent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectEmailSentCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectEmailSentCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectEmailSentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProspect"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/prospects/{id}/record-bounce": {
      "post": {
        "tags": [
          "Prospects"
        ],
        "summary": "Record a bounce of an email sent to a Prospect",
        "description": "Writes a `bounce` entry in the Prospect's History for the `email_sent` entry `sentEmailId` (its `id` in `history`); without it, the Prospect's newest Sent email. `bouncedAt` is an ISO 8601 time such as `2026-11-02T10:05:00Z` (a time without an offset is read in the time zone of your Sales account member, or in UTC when it has none; now when left out; not in the future and not before the email was sent). The optional `note` (at most 2000 characters) is the reason. An email has one bounce: recording it again at the same minute changes nothing and answers the Prospect, a different one answers 422 on `sentEmailId`. A Prospect with no Sent email, or a `sentEmailId` that is not one of its Sent emails, answers 422 on `sentEmailId`. The optional `statusId` gives the Prospect that Status in the same call, dated at `bouncedAt`; it must be a Status of the Prospect's Campaign, and a Prospect in a final Status is refused with 422 on `statusId`. A Prospect in a final Status, and a Blocked one, can still record a bounce when `statusId` is left out. Every refusal answers 422 on its field and stores nothing. Answers the Prospect with its History, where the `email_sent` entry carries the `bounceId`.",
        "operationId": "prospects.record-bounce",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectBounceCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectBounceCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProspectBounceCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProspect"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/uploads": {
      "post": {
        "tags": [
          "Uploads"
        ],
        "summary": "Make an Upload link",
        "description": "Returns a link that takes one file for you in this Account, with no bearer. `target` is what the file becomes: `conversation`. Send a small file as one `PUT <url>` with the raw bytes, which also finishes it (Conversation files up to `maxBytes`). Send the file before `expiresAt`. Once finished, name `uploadId` in the one call that takes it. A person can also open `url` in a browser and pick the file there.",
        "operationId": "uploads.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiUploadCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiUploadCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiUploadCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUploadLink"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/conversations": {
      "get": {
        "tags": [
          "Conversations"
        ],
        "summary": "List conversations",
        "description": "The User's conversations with our Assistant, newest first, as the panel's switcher lists them: their own ordinary conversations and every shared one in the Account. A Voice Call the User can open is listed too, and its messages can be read. When the Assistant is turned off for the Account, answers 403.",
        "operationId": "conversations.list",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiListOfApiConversation"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`. `forbidden`: The act is the Account Owner's.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff",
              "forbidden"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "post": {
        "tags": [
          "Conversations"
        ],
        "summary": "Start a conversation",
        "description": "Starts an ordinary conversation of the User with our Assistant, private until the User shares it in the panel, on the Assistant's current model. Send the first message with `POST /api/v1/conversations/{id}/messages`. Answers 201 with the conversation.",
        "operationId": "conversations.create",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiConversation"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`. `forbidden`: The act is the Account Owner's.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff",
              "forbidden"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/conversations/{id}/messages": {
      "post": {
        "tags": [
          "Conversations"
        ],
        "summary": "Send a message to the Assistant",
        "description": "Sends `text` to our Assistant as the User, exactly as the panel does, and answers 202 once the message is stored and the Assistant's turn is on its way; read the reply with `GET …/messages?after={seq}&wait=60`. Answer the Assistant's questions and proposals with your next message. `pageContext` names what the message is about (the panel's Page context). `uploadIds` are finished uploads with target `conversation`, each attached as a Conversation Attachment (at most 25 MiB, a PDF, image, text, Markdown, CSV, XLSX, or DOCX file). A send spends the Assistant allowance: an empty allowance answers 402 `allowance-exhausted`. A private conversation with a turn still running, or a Voice Call, answers 409. A field problem answers 422.",
        "operationId": "conversations.send-message",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiConversationMessageSend"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiConversationMessageSend"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiConversationMessageSend"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiConversationMessageSent"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "402": {
            "description": "`allowance-exhausted`: The Assistant allowance is empty.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "allowance-exhausted"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`. `forbidden`: The act is the Account Owner's.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff",
              "forbidden"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "409": {
            "description": "`conflict`: The act clashes with the record's state.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "conflict"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      },
      "get": {
        "tags": [
          "Conversations"
        ],
        "summary": "Read messages",
        "description": "The conversation's messages after `after` (a `seq`; omit it for all), oldest first, with the turn state (`running` or `idle`). With `wait` (seconds, at most 60), when there are no messages after `after` yet and the Assistant is still answering, the call holds until the Assistant writes a message, its turn ends, or `wait` passes; a Voice Call that is still live never holds, and answers the transcript so far; so after a send, read with `after` set to the send's `seq` and `wait=60`, and read again while `turnState` is `running`. Each message carries its role (`user`, `assistant`, or `room`), its sender, its markdown text, its attachments, and the tools the Assistant ran before it with their outcome. Thinking never comes back.",
        "operationId": "conversations.list-messages",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int64"
            }
          },
          {
            "name": "wait",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiConversationMessages"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`. `forbidden`: The act is the Account Owner's.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff",
              "forbidden"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "422": {
            "description": "`validation`: The input was refused. `errors` lists fields for a body or query that does not bind; otherwise `detail` gives the rule.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "validation"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/conversations/{id}/stop": {
      "post": {
        "tags": [
          "Conversations"
        ],
        "summary": "Stop the Assistant's turn",
        "description": "Asks the running turn to stop, as the panel's Stop does; the Assistant stops at its next step. Read the messages to see where it stopped. Answers the conversation. A Voice Call is stopped from the Assistant panel, so stopping one answers 409.",
        "operationId": "conversations.stop",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiConversation"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`no-account`: The credential is in no Account the User belongs to. `accounts` lists where it can switch to. `license-closed`: The Account's Sales License is Closed. `detail` gives the reason. `browser-handoff`: A person must finish this act in the browser: open `handoffUrl`. `forbidden`: The act is the Account Owner's.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "no-account",
              "license-closed",
              "browser-handoff",
              "forbidden"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "409": {
            "description": "`conflict`: The act clashes with the record's state.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "conflict"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/accounts": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List the User's Accounts",
        "description": "Lists every Account the signed-in User belongs to, each with `current` true for the Account the credential acts in now. Works even when the current Account is unusable (no membership, a Closed License, no Legal Acceptance), so call it first when another call answers `no-account`.",
        "operationId": "accounts.list",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiListOfApiAccountListItem"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    },
    "/api/v1/accounts/{accountId}/switch": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Switch the credential to another Account",
        "description": "Moves the credential into the Account `accountId`, so every later call acts there until the next switch. Answers with the Account list, the new Account marked `current`. An Account the User is not in answers `not-found`. An Account without a current License for this product answers `license-closed`, and the credential stays where it is.",
        "operationId": "accounts.switch",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiListOfApiAccountListItem"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: No bearer, or an unknown, ended, or expired credential. `WWW-Authenticate` names the Protected Resource Metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "unauthorized"
            ]
          },
          "403": {
            "description": "`license-closed`: The Account's Sales License is Closed. `detail` gives the reason.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "license-closed"
            ]
          },
          "404": {
            "description": "`not-found`: No such record in this Account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "not-found"
            ]
          },
          "429": {
            "description": "`rate-limited`: Over the per-User rate limit. `Retry-After` says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problem-types": [
              "rate-limited"
            ]
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiAccount": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ApiAccountListItem": {
        "required": [
          "id",
          "name",
          "current"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "current": {
            "type": "boolean"
          }
        }
      },
      "ApiCampaign": {
        "required": [
          "account",
          "id",
          "url",
          "name",
          "prospectCount",
          "followUpDueCount",
          "createdAt",
          "statuses"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prospectCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "followUpDueCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "statuses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiCampaignStatus"
            }
          }
        }
      },
      "ApiCampaignCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "template": {
            "type": [
              "null",
              "string"
            ]
          },
          "copyStatusesFromCampaignId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "statuses": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ApiCampaignStatusInput"
            }
          }
        }
      },
      "ApiCampaignItem": {
        "required": [
          "id",
          "url",
          "name",
          "prospectCount",
          "followUpDueCount",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prospectCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "followUpDueCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiCampaignStatus": {
        "required": [
          "id",
          "name",
          "position",
          "followUpAfterWorkingDays",
          "isFinal",
          "prospectCount"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "followUpAfterWorkingDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isFinal": {
            "type": "boolean"
          },
          "prospectCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiCampaignStatusInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "followUpAfterWorkingDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isFinal": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiCampaignStatusUpdate": {
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "followUpAfterWorkingDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isFinal": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiCampaignUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "At most 100 characters."
          },
          "statuses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiCampaignStatusUpdate"
            },
            "description": "The whole ordered list of Statuses, numbered 1 to n in this order. A row with the `id` of a Status the Campaign holds keeps that Status; a row without `id` is a new Status; a Status left out of the list is removed. A follow-up left out means none."
          }
        }
      },
      "ApiConversation": {
        "required": [
          "account",
          "id",
          "title",
          "url",
          "origin",
          "turnState",
          "shared",
          "closed",
          "model",
          "lastError",
          "splitFromConversationId",
          "createdAt",
          "lastMessageAt"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "turnState": {
            "type": "string"
          },
          "shared": {
            "type": "boolean"
          },
          "closed": {
            "type": "boolean"
          },
          "model": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          },
          "splitFromConversationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastMessageAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiConversationMessage": {
        "required": [
          "id",
          "seq",
          "role",
          "sender",
          "text",
          "attachments",
          "toolActivity",
          "turnState",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "seq": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "role": {
            "type": "string"
          },
          "sender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiMessageSender"
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiMessageAttachment"
            }
          },
          "toolActivity": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiToolActivity"
            }
          },
          "turnState": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiConversationMessages": {
        "required": [
          "account",
          "conversationId",
          "turnState",
          "lastError",
          "items"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "conversationId": {
            "type": "string",
            "format": "uuid"
          },
          "turnState": {
            "type": "string"
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiConversationMessage"
            }
          }
        }
      },
      "ApiConversationMessageSend": {
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "pageContext": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiPageContext"
              }
            ]
          },
          "uploadIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "x-upload-target": "conversation"
          }
        }
      },
      "ApiConversationMessageSent": {
        "required": [
          "account",
          "messageId",
          "conversationId",
          "seq",
          "queued"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "messageId": {
            "type": "string",
            "format": "uuid"
          },
          "conversationId": {
            "type": "string",
            "format": "uuid"
          },
          "seq": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "queued": {
            "type": "boolean"
          }
        }
      },
      "ApiForm": {
        "required": [
          "account",
          "id",
          "url",
          "name",
          "domains",
          "privacyUrl",
          "buttonLabel",
          "thankYouText",
          "downloadUrl",
          "askName",
          "askCompany",
          "consentText",
          "consentVersion",
          "leadCount",
          "latestSignUpAt",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "privacyUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "buttonLabel": {
            "type": "string"
          },
          "thankYouText": {
            "type": "string"
          },
          "downloadUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "askName": {
            "type": "boolean"
          },
          "askCompany": {
            "type": "boolean"
          },
          "consentText": {
            "type": "string"
          },
          "consentVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "leadCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "latestSignUpAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiFormCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "domains": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "privacyUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "buttonLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "thankYouText": {
            "type": [
              "null",
              "string"
            ]
          },
          "downloadUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "consentText": {
            "type": [
              "null",
              "string"
            ]
          },
          "askName": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "askCompany": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiFormEmailSettings": {
        "required": [
          "account",
          "formId",
          "formName",
          "newLead"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "formId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "formName": {
            "type": "string"
          },
          "newLead": {
            "type": "boolean"
          }
        }
      },
      "ApiFormEmailSettingsUpdate": {
        "type": "object",
        "properties": {
          "newLead": {
            "type": "boolean"
          }
        }
      },
      "ApiFormItem": {
        "required": [
          "id",
          "url",
          "name",
          "domains",
          "privacyUrl",
          "buttonLabel",
          "thankYouText",
          "downloadUrl",
          "askName",
          "askCompany",
          "consentText",
          "consentVersion",
          "leadCount",
          "latestSignUpAt",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "privacyUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "buttonLabel": {
            "type": "string"
          },
          "thankYouText": {
            "type": "string"
          },
          "downloadUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "askName": {
            "type": "boolean"
          },
          "askCompany": {
            "type": "boolean"
          },
          "consentText": {
            "type": "string"
          },
          "consentVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "leadCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "latestSignUpAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiFormSnippet": {
        "required": [
          "account",
          "formId",
          "snippet"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "formId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "snippet": {
            "type": "string"
          }
        }
      },
      "ApiFormUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "At most 100 characters."
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Replaces the whole list of hostnames. An empty list makes the Form accept no sign-up."
          },
          "privacyUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "`https`, or a `localhost` address, at most 2000 characters. `null` or an empty text removes the link; a Form without it takes no sign-ups and has no snippet."
          },
          "buttonLabel": {
            "type": "string",
            "description": "At most 100 characters."
          },
          "thankYouText": {
            "type": "string",
            "description": "At most 1000 characters."
          },
          "downloadUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "`https`, or a `localhost` address, at most 2000 characters. `null` or an empty text removes the Download link."
          },
          "consentText": {
            "type": "string",
            "description": "At most 1000 characters. A text that differs from the current one gives the Form its next `consentVersion`."
          },
          "askName": {
            "type": "boolean"
          },
          "askCompany": {
            "type": "boolean"
          }
        }
      },
      "ApiLead": {
        "required": [
          "account",
          "id",
          "url",
          "formId",
          "formName",
          "email",
          "name",
          "company",
          "pageUrl",
          "utmSource",
          "utmMedium",
          "utmCampaign",
          "utmContent",
          "consentVersion",
          "consentText",
          "firstSignedUpAt",
          "lastSignedUpAt"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "url": {
            "type": "string"
          },
          "formId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "formName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "company": {
            "type": [
              "null",
              "string"
            ]
          },
          "pageUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "utmSource": {
            "type": [
              "null",
              "string"
            ]
          },
          "utmMedium": {
            "type": [
              "null",
              "string"
            ]
          },
          "utmCampaign": {
            "type": [
              "null",
              "string"
            ]
          },
          "utmContent": {
            "type": [
              "null",
              "string"
            ]
          },
          "consentVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "consentText": {
            "type": "string"
          },
          "firstSignedUpAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSignedUpAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiLeadAddToCampaign": {
        "type": "object",
        "properties": {
          "campaignId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "ApiLeadItem": {
        "required": [
          "id",
          "url",
          "formId",
          "formName",
          "email",
          "name",
          "company",
          "pageUrl",
          "utmSource",
          "utmMedium",
          "utmCampaign",
          "utmContent",
          "consentVersion",
          "consentText",
          "firstSignedUpAt",
          "lastSignedUpAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "url": {
            "type": "string"
          },
          "formId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "formName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "company": {
            "type": [
              "null",
              "string"
            ]
          },
          "pageUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "utmSource": {
            "type": [
              "null",
              "string"
            ]
          },
          "utmMedium": {
            "type": [
              "null",
              "string"
            ]
          },
          "utmCampaign": {
            "type": [
              "null",
              "string"
            ]
          },
          "utmContent": {
            "type": [
              "null",
              "string"
            ]
          },
          "consentVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "consentText": {
            "type": "string"
          },
          "firstSignedUpAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSignedUpAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiListOfApiAccountListItem": {
        "required": [
          "account",
          "items",
          "total",
          "nextOffset"
        ],
        "type": "object",
        "properties": {
          "account": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiAccount"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiAccountListItem"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nextOffset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiListOfApiCampaignItem": {
        "required": [
          "account",
          "items",
          "total",
          "nextOffset"
        ],
        "type": "object",
        "properties": {
          "account": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiAccount"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiCampaignItem"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nextOffset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiListOfApiConversation": {
        "required": [
          "account",
          "items",
          "total",
          "nextOffset"
        ],
        "type": "object",
        "properties": {
          "account": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiAccount"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiConversation"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nextOffset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiListOfApiFormItem": {
        "required": [
          "account",
          "items",
          "total",
          "nextOffset"
        ],
        "type": "object",
        "properties": {
          "account": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiAccount"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiFormItem"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nextOffset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiListOfApiLeadItem": {
        "required": [
          "account",
          "items",
          "total",
          "nextOffset"
        ],
        "type": "object",
        "properties": {
          "account": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiAccount"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiLeadItem"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nextOffset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiListOfApiProspectItem": {
        "required": [
          "account",
          "items",
          "total",
          "nextOffset"
        ],
        "type": "object",
        "properties": {
          "account": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiAccount"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiProspectItem"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nextOffset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiMessageAttachment": {
        "required": [
          "id",
          "fileName",
          "contentType"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          }
        }
      },
      "ApiMessageSender": {
        "required": [
          "userId",
          "personId",
          "name"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "personId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ApiPageContext": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "route": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ApiProspect": {
        "required": [
          "account",
          "id",
          "url",
          "campaignId",
          "campaignName",
          "statusId",
          "statusName",
          "statusIsFinal",
          "email",
          "name",
          "role",
          "organisation",
          "emailSource",
          "whyItFits",
          "notes",
          "tags",
          "timeZone",
          "statusChangedAt",
          "createdAt",
          "lastEmailAt",
          "followUpDue",
          "blockedBy",
          "leadIds",
          "history"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "url": {
            "type": "string"
          },
          "campaignId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "campaignName": {
            "type": "string"
          },
          "statusId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "statusName": {
            "type": "string"
          },
          "statusIsFinal": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "organisation": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailSource": {
            "type": "string"
          },
          "whyItFits": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "timeZone": {
            "type": [
              "null",
              "string"
            ]
          },
          "statusChangedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastEmailAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "followUpDue": {
            "type": "boolean"
          },
          "blockedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiProspectBlocker"
              }
            ]
          },
          "leadIds": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int64"
            }
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiProspectHistoryEntry"
            }
          }
        }
      },
      "ApiProspectBlocker": {
        "required": [
          "id",
          "email",
          "statusName",
          "campaignName",
          "match"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "email": {
            "type": "string"
          },
          "statusName": {
            "type": "string"
          },
          "campaignName": {
            "type": "string"
          },
          "match": {
            "type": "string"
          }
        }
      },
      "ApiProspectBounceCreate": {
        "type": "object",
        "properties": {
          "sentEmailId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The id of the `email_sent` History entry that bounced. Optional: the Prospect's newest Sent email when left out.",
            "format": "int64"
          },
          "bouncedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the bounce arrived, an ISO 8601 time such as 2026-11-02T10:05:00Z. A time without an offset is read in the time zone of your Sales account member, or in UTC when it has none. Optional: now when left out. Not in the future and not before the email was sent."
          },
          "note": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reason of the bounce, at most 2000 characters. Optional."
          },
          "statusId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Optional. A Status of the Prospect's Campaign to give the Prospect in the same call, dated at the Bounced time. A Prospect in a final Status is refused with 422 on `statusId` and nothing is stored.",
            "format": "int64"
          }
        }
      },
      "ApiProspectCreate": {
        "type": "object",
        "properties": {
          "campaignId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "email": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required, a valid address, at most 254 characters, unique among the Prospects of the Account. A Prospect that would be Blocked is refused: another Prospect of the Account in a final Status has an address at the same email domain (a free-mail domain such as gmail.com never matches), and the answer is 422 on `email` with that Prospect in `blockedBy`. A Prospect created in a final Status is never refused by this rule."
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "organisation": {
            "type": [
              "null",
              "string"
            ],
            "description": "At most 200 characters. A Prospect that would be Blocked is refused: another Prospect of the Account in a final Status has the same organisation (any email domain, letter case and extra spaces ignored; an empty organisation matches nothing), and the answer is 422 on `organisation` with that Prospect in `blockedBy`. A Prospect created in a final Status is never refused by this rule."
          },
          "emailSource": {
            "type": [
              "null",
              "string"
            ]
          },
          "whyItFits": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ],
            "description": "At most 4000 characters. The Prospect's own notes about the person, which can be changed later. To add a dated note to the Prospect's History, call `prospects.add-note` (`POST /api/v1/prospects/{id}/add-note`)."
          },
          "tags": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Tags of the Prospect, any number. A Tag is at most 50 characters after trimming and has no comma; empty ones are dropped and Tags that differ only in letter case or surrounding spaces are one. A Tag the Account already has keeps its stored spelling. A refused Tag answers 422 on `tags` and nothing is stored."
          },
          "timeZone": {
            "type": [
              "null",
              "string"
            ],
            "description": "An IANA time zone name from the list a member sees in their user settings, such as `Europe/Amsterdam`, matched ignoring letter case and stored as the list spells it. Empty, `null`, or absent means Unknown. Anything else, such as `EST` or a Windows zone name, answers 422 on `timeZone`."
          }
        }
      },
      "ApiProspectEmailSentCreate": {
        "type": "object",
        "properties": {
          "subject": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required, at most 500 characters."
          },
          "sentAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the email was sent, an ISO 8601 time such as 2026-11-02T10:00:00Z. A time without an offset is read in the time zone of your Sales account member, or in UTC when it has none. Optional: now when left out. Not in the future."
          },
          "messageId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The Message-ID header of the email, at most 500 characters. Optional. Recording the same Message-ID again for the Prospect changes nothing; without one, the same subject sent in the same minute counts as the same email."
          },
          "note": {
            "type": [
              "null",
              "string"
            ],
            "description": "A comment for the History entry, at most 2000 characters. Optional."
          },
          "statusId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Optional. A Status of the Prospect's Campaign to give the Prospect in the same call, dated at the Sent time. A Prospect in a final Status is refused with 422 on `statusId` and nothing is stored.",
            "format": "int64"
          }
        }
      },
      "ApiProspectHistoryEntry": {
        "required": [
          "id",
          "kind",
          "at",
          "statusName",
          "fromCampaignName",
          "toCampaignName",
          "note",
          "subject",
          "messageId",
          "sentTo",
          "sentEmailId",
          "bounceId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "kind": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "statusName": {
            "type": [
              "null",
              "string"
            ]
          },
          "fromCampaignName": {
            "type": [
              "null",
              "string"
            ]
          },
          "toCampaignName": {
            "type": [
              "null",
              "string"
            ]
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "subject": {
            "type": [
              "null",
              "string"
            ]
          },
          "messageId": {
            "type": [
              "null",
              "string"
            ]
          },
          "sentTo": {
            "type": [
              "null",
              "string"
            ]
          },
          "sentEmailId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "bounceId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "ApiProspectImport": {
        "required": [
          "imported",
          "skipped",
          "notesAdded",
          "sentEmailsAdded",
          "bouncesAdded"
        ],
        "type": "object",
        "properties": {
          "imported": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "skipped": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notesAdded": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sentEmailsAdded": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bouncesAdded": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiProspectItem": {
        "required": [
          "id",
          "url",
          "campaignId",
          "campaignName",
          "statusId",
          "statusName",
          "statusIsFinal",
          "email",
          "name",
          "role",
          "organisation",
          "emailSource",
          "whyItFits",
          "notes",
          "tags",
          "timeZone",
          "statusChangedAt",
          "createdAt",
          "lastEmailAt",
          "followUpDue",
          "blockedBy"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "url": {
            "type": "string"
          },
          "campaignId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "campaignName": {
            "type": "string"
          },
          "statusId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "statusName": {
            "type": "string"
          },
          "statusIsFinal": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "organisation": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailSource": {
            "type": "string"
          },
          "whyItFits": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "timeZone": {
            "type": [
              "null",
              "string"
            ]
          },
          "statusChangedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastEmailAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "followUpDue": {
            "type": "boolean"
          },
          "blockedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiProspectBlocker"
              }
            ]
          }
        }
      },
      "ApiProspectNoteCreate": {
        "type": "object",
        "properties": {
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ApiProspectSetStatus": {
        "type": "object",
        "properties": {
          "prospectIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int64"
            },
            "description": "Required, at least one. The Prospects to change; all of them are in the Campaign the Status belongs to, or nothing is changed and the answer is 422."
          },
          "statusId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ApiProspectStatusChange": {
        "required": [
          "changed",
          "skippedFinal"
        ],
        "type": "object",
        "properties": {
          "changed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "skippedFinal": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiProspectUpdate": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "A valid address, at most 254 characters, unique among the Prospects of the Account. A Prospect in a final Status keeps its address: another one answers 422. A change of address that makes the Prospect Blocked, because another Prospect of the Account in a final Status has an address at the same email domain (a free-mail domain such as gmail.com never matches), answers 422 on `email` with that Prospect in `blockedBy`; a Prospect in a final Status is never refused by this rule."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "At most 200 characters."
          },
          "role": {
            "type": [
              "null",
              "string"
            ],
            "description": "At most 200 characters."
          },
          "organisation": {
            "type": [
              "null",
              "string"
            ],
            "description": "At most 200 characters. A change of organisation that makes the Prospect Blocked, because another Prospect of the Account in a final Status has the same organisation (any email domain, letter case and extra spaces ignored; an empty organisation matches nothing), answers 422 on `organisation` with that Prospect in `blockedBy`; a Prospect in a final Status is never refused by this rule."
          },
          "emailSource": {
            "type": "string",
            "description": "At most 1000 characters. The public page, and the words on it, that show the address."
          },
          "whyItFits": {
            "type": [
              "null",
              "string"
            ],
            "description": "At most 2000 characters."
          },
          "notes": {
            "type": [
              "null",
              "string"
            ],
            "description": "At most 4000 characters. The Prospect's own notes about the person, which can be changed later. To add a dated note to the Prospect's History, call `prospects.add-note` (`POST /api/v1/prospects/{id}/add-note`)."
          },
          "tags": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Replaces the Prospect's Tags with this array. Absent keeps them; `[]` and `null` clear them. A Tag is at most 50 characters after trimming and has no comma; empty ones are dropped and Tags that differ only in letter case or surrounding spaces are one. A Tag the Account already has keeps its stored spelling. A refused Tag answers 422 on `tags` and nothing is stored."
          },
          "timeZone": {
            "type": [
              "null",
              "string"
            ],
            "description": "An IANA time zone name from the list a member sees in their user settings, such as `Europe/Amsterdam`, matched ignoring letter case and stored as the list spells it. `null` and an empty value set Unknown. Absent keeps the time zone. Anything else, such as `EST` or a Windows zone name, answers 422 on `timeZone`."
          },
          "campaignId": {
            "type": [
              "integer",
              "string"
            ],
            "description": "Moves the Prospect to this Campaign of the Account: to the Status with the same name there, or the first Status. A move writes a `move` entry in the History. A Prospect in a final Status stays in its Campaign: another one answers 422. The Campaign it is in changes nothing. A move is never refused because the Prospect is Blocked.",
            "format": "int64"
          }
        }
      },
      "ApiToolActivity": {
        "required": [
          "name",
          "outcome",
          "isWrite"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          },
          "isWrite": {
            "type": "boolean"
          }
        }
      },
      "ApiUploadCreate": {
        "required": [
          "target",
          "fileName"
        ],
        "type": "object",
        "properties": {
          "target": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ApiUploadLink": {
        "required": [
          "account",
          "uploadId",
          "url",
          "target",
          "fileName",
          "partSize",
          "maxBytes",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ApiAccount"
          },
          "uploadId": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "partSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "maxBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "Problem": {
        "required": [
          "type",
          "title",
          "status"
        ],
        "type": "object",
        "properties": {
          "type": {
            "enum": [
              "unauthorized",
              "allowance-exhausted",
              "no-account",
              "license-closed",
              "browser-handoff",
              "forbidden",
              "not-found",
              "conflict",
              "validation",
              "rate-limited"
            ],
            "type": "string",
            "description": "The stable problem token. An unexpected failure (500) answers `about:blank`."
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "format": "int64"
              },
              "name": {
                "type": "string"
              }
            },
            "description": "The Account acted in, when known."
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "format": "int64"
                },
                "name": {
                  "type": "string"
                }
              }
            },
            "description": "`no-account` only: the Accounts the credential can switch to."
          },
          "handoffUrl": {
            "type": "string",
            "description": "`browser-handoff` only: the page where a person finishes the act.",
            "format": "uri"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "`validation` only, for a body that does not bind: messages by camelCase field."
          }
        },
        "description": "ProblemDetails (RFC 9457). Branch on `type`; `title` and `detail` are in the User's UI language."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "agentConnection": {
        "type": "oauth2",
        "description": "An Agent connection: OAuth 2 authorization code with PKCE at Auth, for the resource `https://demo.mvdm.io/sales/api`. No consent step beyond the sign-in itself.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://auth.mvdm.io/connect/authorize",
            "tokenUrl": "https://auth.mvdm.io/connect/token",
            "refreshUrl": "https://auth.mvdm.io/connect/token",
            "scopes": { }
          }
        }
      },
      "personalToken": {
        "type": "http",
        "description": "A Personal token (`mvdm_pat_…`), created on API & Agent Access on Auth.",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "agentConnection": [ ]
    },
    {
      "personalToken": [ ]
    }
  ],
  "tags": [
    {
      "name": "Accounts"
    },
    {
      "name": "Campaigns"
    },
    {
      "name": "Conversations"
    },
    {
      "name": "Email settings"
    },
    {
      "name": "Forms"
    },
    {
      "name": "Leads"
    },
    {
      "name": "Legal Acceptance"
    },
    {
      "name": "Prospects"
    },
    {
      "name": "Uploads"
    }
  ]
}