{
  "openapi": "3.1.1",
  "info": {
    "title": "Intellayer Public API",
    "description": "Read and write your organisation's records from your own systems. Every request carries an API key made on Settings > API and webhooks.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.intellayer.app"
    }
  ],
  "paths": {
    "/api/public/v1/leads": {
      "get": {
        "tags": [
          "PublicLeads"
        ],
        "summary": "List leads",
        "description": "Returns a page of the leads the key can see, newest first. Pages start at 1; pageSize runs up to 100 (25 by default), and meta.totalCount holds the total. Filter by updatedSince (changed at or after a UTC instant), status (New, Contacted, SiteVisitScheduled, ProposalSent, Negotiation, Won or Lost; 400 otherwise) or email (exact, any case). Filtering by email needs a key that may read personal data (403 otherwise), since the answer would say whether that person is on file. Needs View on leads. Record scope applies as in the app: the key sees only what its role's scope (own, team, team tree or all) allows.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "updatedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListOfPublicLead"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PublicLeads"
        ],
        "summary": "Create a lead",
        "description": "Creates a lead owned by the key's creator, in the organisation's first pipeline stage unless stageId names another; source defaults to \"api\". firstName and lastName are required, and a business lead needs a companyId the key can see (404 otherwise). Answers 201 with the new lead, or 409 errors.installer.recordLimitReached when the plan's limit for leads and customers is reached. Needs Create on leads.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicLeadCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicLeadCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicLeadCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicLead"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/leads/{id}": {
      "get": {
        "tags": [
          "PublicLeads"
        ],
        "summary": "Get a lead",
        "description": "Returns one lead. Needs View on leads. One the key cannot see answers 404, the same as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicLead"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "PublicLeads"
        ],
        "summary": "Update a lead",
        "description": "Changes only the fields sent and leaves the rest. A status change is logged on the lead; an unknown status answers 400. companyId must be a company the key can see, and the empty GUID unlinks it. Needs Update on leads. One the key cannot see answers 404, the same as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicLeadUpdate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicLeadUpdate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicLeadUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicLead"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/customers": {
      "get": {
        "tags": [
          "PublicCustomers"
        ],
        "summary": "List customers",
        "description": "Returns a page of the customers the key can see, newest first. Pages start at 1; pageSize runs up to 100 (25 by default), and meta.totalCount holds the total. Archived customers are left out unless includeArchived=true. Filter by updatedSince or email (exact, any case); filtering by email needs a key that may read personal data (403 otherwise). Needs View on customers. Record scope applies as in the app: the key sees only what its role's scope (own, team, team tree or all) allows.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "updatedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "email",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListOfPublicCustomer"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PublicCustomers"
        ],
        "summary": "Create a customer",
        "description": "Creates a customer as a contact, without a portal login, owned by the key's creator. firstName and lastName are required, and a business customer needs a companyId the key can see (404 otherwise). Setting email needs a key that may read personal data (403 otherwise), since refusing a duplicate would say whether that person is on file. Answers 201 with the new customer. Needs Create on customers.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCustomerCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCustomerCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCustomerCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicCustomer"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/customers/{id}": {
      "get": {
        "tags": [
          "PublicCustomers"
        ],
        "summary": "Get a customer",
        "description": "Returns one customer, archived or not. Needs View on customers. One the key cannot see answers 404, the same as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicCustomer"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "PublicCustomers"
        ],
        "summary": "Update a customer",
        "description": "Changes only the fields sent and leaves the rest. Changing email never changes the address a customer signs in to the portal with, and setting it needs a key that may read personal data (403 otherwise). Needs Update on customers. One the key cannot see answers 404, the same as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCustomerUpdate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCustomerUpdate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCustomerUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicCustomer"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/companies": {
      "get": {
        "tags": [
          "PublicCompanies"
        ],
        "summary": "List companies",
        "description": "Returns a page of the companies the key can see, newest first. Pages start at 1; pageSize runs up to 100 (25 by default), and meta.totalCount holds the total. Filter by updatedSince. Needs View on companies. Record scope applies as in the app: the key sees only what its role's scope (own, team, team tree or all) allows.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "updatedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListOfPublicCompany"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PublicCompanies"
        ],
        "summary": "Create a company",
        "description": "Creates a company. Only name is required. Answers 201 with the new company. Needs Create on companies.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCompanyWrite"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCompanyWrite"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCompanyWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicCompany"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/companies/{id}": {
      "get": {
        "tags": [
          "PublicCompanies"
        ],
        "summary": "Get a company",
        "description": "Returns one company. Needs View on companies. One the key cannot see answers 404, the same as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicCompany"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "PublicCompanies"
        ],
        "summary": "Replace a company's details",
        "description": "Replaces the company's details with the ones sent: a field left blank is cleared, so send every field you want to keep. Only name is required. ownerUserId left out keeps the owner; each legal identity field (tradingName, legalForm, registrationNumber, taxId, industry, employeeBand) left out stays as it is, and an empty string clears it. Needs Update on companies. One the key cannot see answers 404, the same as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCompanyWrite"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCompanyWrite"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCompanyWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicCompany"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tasks": {
      "get": {
        "tags": [
          "PublicTasks"
        ],
        "summary": "List tasks",
        "description": "Returns a page of the tasks the key can see, newest first. Pages start at 1; pageSize runs up to 100 (25 by default), and meta.totalCount holds the total. A repeating task appears once, as its series. Filter by updatedSince or status (exact match). Needs View on tasks. Record scope applies as in the app: the key sees only what its role's scope (own, team, team tree or all) allows.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "updatedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListOfPublicTask"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PublicTasks"
        ],
        "summary": "Create a task",
        "description": "Creates a one-off task. title is required; priority defaults to medium and the assignee to the key's creator. A linked customerId or leadId must be one the key can see (404 otherwise). Answers 201 with the new task. Needs Create on tasks.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicTaskCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicTaskCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicTaskCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicTask"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tasks/{id}": {
      "get": {
        "tags": [
          "PublicTasks"
        ],
        "summary": "Get a task",
        "description": "Returns one task. Needs View on tasks. One the key cannot see answers 404, the same as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicTask"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/me": {
      "get": {
        "tags": [
          "PublicMe"
        ],
        "summary": "Who am I",
        "description": "Returns the calling key (its name, role, expiry, rate limit, and whether it may read personal data), its organisation, and what it may do: for each feature, the scope of each action (none, own, team, team_tree or all). Every key may call it; automation tools use it to test a connection.",
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicMeDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/oauth/token": {
      "post": {
        "tags": [
          "PublicOAuth"
        ],
        "summary": "Get an access token",
        "description": "Exchanges the key for an access token that works for one hour (OAuth 2.0 client credentials). Send grant_type=client_credentials form-encoded, proving the key one way: the client ID and the whole key as HTTP Basic credentials (client_secret_basic) or as client_id and client_secret in the form (client_secret_post), or a client_assertion signed with the key's private key (private_key_jwt). Needs no Authorization: Bearer. Errors follow RFC 6749: error and error_description. 30 requests a minute per address.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PublicTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTokenError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTokenError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/public/v1/proposals": {
      "get": {
        "tags": [
          "PublicProposals"
        ],
        "summary": "List proposals",
        "description": "Returns a page of proposals (quotes), newest first, visible as their customer or lead is. Pages start at 1; pageSize runs up to 100 (25 by default), and meta.totalCount holds the total. Filter by updatedSince or status (Draft, Sent, Viewed, Accepted, Rejected or Expired; 400 otherwise). Read-only. Needs View on proposals.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "updatedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListOfPublicProposal"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/proposals/{id}": {
      "get": {
        "tags": [
          "PublicProposals"
        ],
        "summary": "Get a proposal",
        "description": "Returns one proposal. Needs View on proposals. One the key cannot see answers 404, the same as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicProposal"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/invoices": {
      "get": {
        "tags": [
          "PublicInvoices"
        ],
        "summary": "List invoices",
        "description": "Returns a page of the invoices the organisation issued, newest first, visible as their customer is. Pages start at 1; pageSize runs up to 100 (25 by default), and meta.totalCount holds the total. Filter by updatedSince or status (draft, sent, paid, partially_paid, overdue or cancelled). Read-only. Needs View on invoices.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "updatedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListOfPublicInvoice"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/invoices/{id}": {
      "get": {
        "tags": [
          "PublicInvoices"
        ],
        "summary": "Get an invoice",
        "description": "Returns one invoice. Needs View on invoices. One the key cannot see answers 404, the same as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicInvoice"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/pipeline-stages": {
      "get": {
        "tags": [
          "PublicPipelineStages"
        ],
        "summary": "List pipeline stages",
        "description": "Returns all the organisation's pipeline stages in their order, not paged: the ids to put in a lead's stageId. Needs View on leads.",
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListOfPublicPipelineStage"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/webhooks/events": {
      "get": {
        "tags": [
          "PublicWebhooks"
        ],
        "summary": "List webhook events",
        "description": "The events this organisation offers, each with available: whether the key's role can read the records the event is about. Only those can be subscribed to.",
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListOfPublicWebhookEvent"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/webhooks": {
      "get": {
        "tags": [
          "PublicWebhooks"
        ],
        "summary": "List the key's subscriptions",
        "description": "The webhook subscriptions this key made, newest first, with whether each is switched on, its verification status and its payload mode. Not paged. A key never sees subscriptions made in the app or by another key.",
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListOfPublicWebhookSubscription"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PublicWebhooks"
        ],
        "summary": "Subscribe a URL to events",
        "description": "Subscribes an https URL on the public internet to events and answers 201 with the signing secret, shown only this once. Nothing is delivered until the URL answers the verification challenge, sent within seconds, and every Owner is emailed the destination. The key's role must be able to read each event's records (403 otherwise). payloadMode is thin (the default) or full. 400 for an unknown event, an address that is not allowed or a bad header; 409 when the organisation already has as many subscriptions as it may.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicWebhookSubscribe"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicWebhookSubscribe"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicWebhookSubscribe"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicWebhookCreated"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/webhooks/{id}": {
      "delete": {
        "tags": [
          "PublicWebhooks"
        ],
        "summary": "Unsubscribe",
        "description": "Removes a subscription this key made; nothing more is delivered to it. A subscription made in the app or by another key answers 404, as one that does not exist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": { }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPublicDeleted"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          },
          "validationErrors": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "ApiResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": { },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfListOfPublicCompany": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PublicCompany"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfListOfPublicCustomer": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PublicCustomer"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfListOfPublicInvoice": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PublicInvoice"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfListOfPublicLead": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PublicLead"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfListOfPublicPipelineStage": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PublicPipelineStage"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfListOfPublicProposal": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PublicProposal"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfListOfPublicTask": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PublicTask"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfListOfPublicWebhookEvent": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PublicWebhookEvent"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfListOfPublicWebhookSubscription": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PublicWebhookSubscription"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfPublicCompany": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicCompany"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfPublicCustomer": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicCustomer"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfPublicDeleted": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicDeleted"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfPublicInvoice": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicInvoice"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfPublicLead": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicLead"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfPublicMeDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicMeDto"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfPublicProposal": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicProposal"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfPublicTask": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicTask"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiResponseOfPublicWebhookCreated": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicWebhookCreated"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiError"
              }
            ]
          },
          "meta": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          },
          "redacted": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "PaginationMeta": {
        "type": "object",
        "properties": {
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasNext": {
            "type": "boolean"
          },
          "hasPrevious": {
            "type": "boolean"
          }
        }
      },
      "PublicCompany": {
        "required": [
          "id",
          "name",
          "vatNumber",
          "countryCode",
          "address",
          "city",
          "postalCode",
          "phone",
          "email",
          "website",
          "notes",
          "ownerUserId",
          "viesStatus",
          "viesCheckedAt",
          "createdAt",
          "updatedAt",
          "tradingName",
          "legalForm",
          "registrationNumber",
          "taxId",
          "industry",
          "employeeBand"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "vatNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "viesStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "viesCheckedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "tradingName": {
            "type": [
              "null",
              "string"
            ]
          },
          "legalForm": {
            "type": [
              "null",
              "string"
            ]
          },
          "registrationNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxId": {
            "type": [
              "null",
              "string"
            ]
          },
          "industry": {
            "type": [
              "null",
              "string"
            ]
          },
          "employeeBand": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PublicCompanyWrite": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "vatNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "tradingName": {
            "type": [
              "null",
              "string"
            ]
          },
          "legalForm": {
            "type": [
              "null",
              "string"
            ]
          },
          "registrationNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxId": {
            "type": [
              "null",
              "string"
            ]
          },
          "industry": {
            "type": [
              "null",
              "string"
            ]
          },
          "employeeBand": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PublicCustomer": {
        "required": [
          "id",
          "firstName",
          "lastName",
          "email",
          "phone",
          "address",
          "city",
          "district",
          "postalCode",
          "countryCode",
          "companyId",
          "ownerUserId",
          "assignedTeamId",
          "stageId",
          "notes",
          "source",
          "archivedAt",
          "createdAt",
          "updatedAt",
          "kind"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "district": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "companyId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "ownerUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "assignedTeamId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "stageId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": "string"
          },
          "archivedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string"
          }
        }
      },
      "PublicCustomerCreate": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "district": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "companyId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "PublicCustomerUpdate": {
        "type": "object",
        "properties": {
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "district": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "companyId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "ownerUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PublicDeleted": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "PublicInvoice": {
        "required": [
          "id",
          "invoiceNumber",
          "type",
          "status",
          "customerId",
          "currency",
          "subtotal",
          "vatAmount",
          "total",
          "amountPaid",
          "issueDate",
          "dueDate",
          "paidDate",
          "billingName",
          "billingVatNumber",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "customerId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "currency": {
            "type": "string"
          },
          "subtotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "vatAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "amountPaid": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "dueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "paidDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "billingName": {
            "type": [
              "null",
              "string"
            ]
          },
          "billingVatNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PublicKeyDto": {
        "required": [
          "id",
          "name",
          "role",
          "expiresAt",
          "rateLimitPerMinute",
          "canReadPersonalData"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "rateLimitPerMinute": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "canReadPersonalData": {
            "type": "boolean"
          }
        }
      },
      "PublicLead": {
        "required": [
          "id",
          "firstName",
          "lastName",
          "email",
          "phone",
          "address",
          "city",
          "district",
          "postalCode",
          "countryCode",
          "status",
          "stageId",
          "priority",
          "source",
          "companyId",
          "ownerUserId",
          "assignedUserId",
          "estimatedBudgetEur",
          "propertyType",
          "notes",
          "nextFollowUpAt",
          "convertedCustomerId",
          "createdAt",
          "updatedAt",
          "kind"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "district": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "stageId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priority": {
            "type": "string"
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "companyId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "ownerUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "assignedUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "estimatedBudgetEur": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "propertyType": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextFollowUpAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "convertedCustomerId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string"
          }
        }
      },
      "PublicLeadCreate": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "district": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "stageId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priority": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "companyId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "assignedUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "estimatedBudgetEur": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "propertyType": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextFollowUpAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "PublicLeadUpdate": {
        "type": "object",
        "properties": {
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "district": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "companyId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "ownerUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "assignedUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "estimatedBudgetEur": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "propertyType": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextFollowUpAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "PublicMeDto": {
        "required": [
          "organization",
          "key",
          "permissions"
        ],
        "type": "object",
        "properties": {
          "organization": {
            "$ref": "#/components/schemas/PublicOrganizationDto"
          },
          "key": {
            "$ref": "#/components/schemas/PublicKeyDto"
          },
          "permissions": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PublicPermissionDto"
            }
          }
        }
      },
      "PublicOrganizationDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "PublicPermissionDto": {
        "required": [
          "view",
          "create",
          "update",
          "delete"
        ],
        "type": "object",
        "properties": {
          "view": {
            "type": "string"
          },
          "create": {
            "type": "string"
          },
          "update": {
            "type": "string"
          },
          "delete": {
            "type": "string"
          }
        }
      },
      "PublicPipelineStage": {
        "required": [
          "id",
          "name",
          "code",
          "sortOrder",
          "phase",
          "isWinStage",
          "isLossStage",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "phase": {
            "type": "string"
          },
          "isWinStage": {
            "type": "boolean"
          },
          "isLossStage": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "PublicProposal": {
        "required": [
          "id",
          "proposalNumber",
          "status",
          "customerId",
          "leadId",
          "customerName",
          "subtotalEur",
          "vatAmountEur",
          "totalCostEur",
          "sentAt",
          "viewedAt",
          "acceptedAt",
          "expiresAt",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "proposalNumber": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "customerId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "leadId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "customerName": {
            "type": "string"
          },
          "subtotalEur": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "vatAmountEur": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalCostEur": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "sentAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "viewedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "acceptedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PublicTask": {
        "required": [
          "id",
          "title",
          "description",
          "category",
          "priority",
          "status",
          "dueDate",
          "dueTime",
          "assignedUserId",
          "assignedTeamId",
          "customerId",
          "leadId",
          "createdByUserId",
          "completedAt",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "dueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "dueTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "time"
          },
          "assignedUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "assignedTeamId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "customerId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "leadId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "createdByUserId": {
            "type": "string",
            "format": "uuid"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PublicTaskCreate": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "type": [
              "null",
              "string"
            ]
          },
          "dueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "dueTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "time"
          },
          "assignedUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "assignedTeamId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "customerId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "leadId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "PublicTokenError": {
        "required": [
          "error",
          "error_description"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "error_description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PublicTokenRequest": {
        "required": [
          "grant_type",
          "client_id",
          "client_secret",
          "client_assertion_type",
          "client_assertion"
        ],
        "type": "object",
        "properties": {
          "grant_type": {
            "type": "string"
          },
          "client_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "client_secret": {
            "type": [
              "null",
              "string"
            ]
          },
          "client_assertion_type": {
            "type": [
              "null",
              "string"
            ]
          },
          "client_assertion": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PublicTokenResponse": {
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "token_type": {
            "type": "string"
          },
          "expires_in": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PublicWebhookCreated": {
        "required": [
          "id",
          "url",
          "events",
          "authHeaderName",
          "payloadMode",
          "verificationStatus",
          "secret"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "authHeaderName": {
            "type": [
              "null",
              "string"
            ]
          },
          "payloadMode": {
            "type": "string"
          },
          "verificationStatus": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          }
        }
      },
      "PublicWebhookEvent": {
        "required": [
          "name",
          "available"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          }
        }
      },
      "PublicWebhookSubscribe": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "events": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "authHeaderName": {
            "type": [
              "null",
              "string"
            ]
          },
          "authHeaderValue": {
            "type": [
              "null",
              "string"
            ]
          },
          "payloadMode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PublicWebhookSubscription": {
        "required": [
          "id",
          "url",
          "events",
          "isActive",
          "createdAt",
          "verificationStatus",
          "verifiedAt",
          "verificationError",
          "payloadMode"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "verificationStatus": {
            "type": "string"
          },
          "verifiedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "verificationError": {
            "type": [
              "null",
              "string"
            ]
          },
          "payloadMode": {
            "type": "string"
          }
        }
      },
      "WebhookThinData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "type": "string",
            "description": "lead, customer, company, task, proposal, invoice or system."
          },
          "url": {
            "type": "string",
            "description": "e.g. /api/public/v1/leads/{id}."
          }
        },
        "description": "A thin webhook payload's data: the record's id, its type, and the API path that returns it."
      },
      "WebhookChange": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "previous": {
            "type": [
              "null",
              "string"
            ]
          },
          "current": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "A field an *.updated event changed. previous and current only in full payloads, and not for a key that may not read personal data."
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "description": "Authorization: Bearer ascpk_… (older keys: ak_…)",
        "scheme": "bearer",
        "bearerFormat": "ascpk_…"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "description": "The same key in the X-Api-Key header, for tools that cannot set Authorization.",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "apiKey": [ ]
    },
    {
      "apiKeyHeader": [ ]
    }
  ],
  "tags": [
    {
      "name": "PublicLeads"
    },
    {
      "name": "PublicCustomers"
    },
    {
      "name": "PublicCompanies"
    },
    {
      "name": "PublicTasks"
    },
    {
      "name": "PublicMe"
    },
    {
      "name": "PublicOAuth"
    },
    {
      "name": "PublicProposals"
    },
    {
      "name": "PublicInvoices"
    },
    {
      "name": "PublicPipelineStages"
    },
    {
      "name": "PublicSystems"
    },
    {
      "name": "PublicWebhooks"
    }
  ],
  "webhooks": {
    "lead.created": {
      "post": {
        "summary": "A lead is created",
        "description": "When a lead is created. The receiver's role must be able to view crm.leads.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "lead.created"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicLead"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "lead.updated": {
      "post": {
        "summary": "A lead is changed",
        "description": "When a save changes any of a lead's details (name, contact details, address, country, status, priority, source, owner, assignee, company, notes, follow-up date, contact preferences and the other fields on the lead), or when someone adds a note to it. One delivery per save, however many fields changed: changes lists each one, and a new note is listed as note. Saving without changing anything sends nothing. A move to another pipeline stage is lead.stage_changed; logging a call, visit, email or meeting sends nothing. The receiver's role must be able to view crm.leads.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "lead.updated"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicLead"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "lead.stage_changed": {
      "post": {
        "summary": "A lead moves to another stage",
        "description": "When a lead is moved to another pipeline stage. The receiver's role must be able to view crm.leads.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "lead.stage_changed"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicLead"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "lead.converted": {
      "post": {
        "summary": "A lead becomes a customer",
        "description": "When a lead is converted into a customer. The lead in data carries the new customer's id in convertedCustomerId. The receiver's role must be able to view crm.leads.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "lead.converted"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicLead"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "customer.created": {
      "post": {
        "summary": "A customer is created",
        "description": "When a customer is created. The receiver's role must be able to view crm.customers.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "customer.created"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicCustomer"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "customer.updated": {
      "post": {
        "summary": "A customer is changed",
        "description": "When a save changes any of a customer's details (name, contact details, address, country, owner, company, billing details, notes, follow-up date, contact preferences and the other fields on the customer), when someone adds a note to it, or when it is archived or restored. One delivery per save, however many fields changed: changes lists each one, and a new note is listed as note. Saving without changing anything sends nothing. A move to another stage is customer.stage_changed; logging a call, visit, email, maintenance or complaint sends nothing. The receiver's role must be able to view crm.customers.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "customer.updated"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicCustomer"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "customer.stage_changed": {
      "post": {
        "summary": "A customer moves to another stage",
        "description": "When a customer is moved to another stage. The receiver's role must be able to view crm.customers.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "customer.stage_changed"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicCustomer"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "company.created": {
      "post": {
        "summary": "A company is created",
        "description": "When a company is created. The receiver's role must be able to view crm.companies.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "company.created"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicCompany"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "company.updated": {
      "post": {
        "summary": "A company is changed",
        "description": "When a company's details are saved. changes is null: the delivery says the company changed, not which fields. The receiver's role must be able to view crm.companies.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "company.updated"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicCompany"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "task.created": {
      "post": {
        "summary": "A task is created",
        "description": "When a task is created. The receiver's role must be able to view crm.tasks.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "task.created"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicTask"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "task.status_changed": {
      "post": {
        "summary": "A task's status changes",
        "description": "When a task's status changes, for example when it is completed. The receiver's role must be able to view crm.tasks.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "task.status_changed"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicTask"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "proposal.created": {
      "post": {
        "summary": "A proposal is created",
        "description": "When a proposal is created. The receiver's role must be able to view crm.proposals.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "proposal.created"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicProposal"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "proposal.status_changed": {
      "post": {
        "summary": "A proposal's status changes",
        "description": "When a proposal's status changes to anything but Accepted (for example Sent, Viewed, Rejected or Expired). The receiver's role must be able to view crm.proposals.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "proposal.status_changed"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicProposal"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "proposal.accepted": {
      "post": {
        "summary": "A proposal is accepted",
        "description": "When a proposal's status becomes Accepted. It is sent instead of proposal.status_changed, not as well. The receiver's role must be able to view crm.proposals.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "proposal.accepted"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicProposal"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "invoice.created": {
      "post": {
        "summary": "An invoice is created",
        "description": "When an invoice is created. The receiver's role must be able to view crm.invoices.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "invoice.created"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicInvoice"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "invoice.status_changed": {
      "post": {
        "summary": "An invoice's status changes",
        "description": "When an invoice's status changes, for example from draft to sent. The receiver's role must be able to view crm.invoices.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "invoice.status_changed"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicInvoice"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "invoice.paid": {
      "post": {
        "summary": "An invoice is paid",
        "description": "When an invoice is recorded as paid. The receiver's role must be able to view crm.invoices.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "invoice.paid"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicInvoice"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    },
    "invoice.overdue": {
      "post": {
        "summary": "An invoice becomes overdue",
        "description": "When an unpaid invoice passes its due date. The receiver's role must be able to view crm.invoices.",
        "parameters": [
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "description": "The delivery's id: the same on every retry of this delivery.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "description": "The event name, as in the body's type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Timestamp",
            "in": "header",
            "description": "Unix seconds when this attempt was signed.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">; a second v1 while a rotated secret overlaps.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "organizationId",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The event's id: the same on every retry and every resend.",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "invoice.overdue"
                    ],
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "data": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PublicInvoice"
                      },
                      {
                        "$ref": "#/components/schemas/WebhookThinData"
                      }
                    ],
                    "description": "The record (full payloads) or a reference to fetch it with (thin, the default)."
                  },
                  "changes": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "$ref": "#/components/schemas/WebhookChange"
                    },
                    "description": "*.updated events of leads and customers: the fields the save changed. Null otherwise."
                  },
                  "redacted": {
                    "type": "boolean",
                    "description": "Present and true when a full payload's personal fields were set to null."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Delivered: any 2xx within 10 seconds. The body is ignored."
          },
          "default": {
            "description": "Anything else, a redirect, or no answer in time: a failure, retried."
          }
        }
      }
    }
  }
}