{
 "openapi": "3.1.0",
 "info": {
  "title": "Empiraa Signal REST API",
  "version": "v1",
  "description": "Read and write Signal CRM data. Every request is authenticated with a workspace API key and acts on that workspace. See the Markdown pages for full details."
 },
 "servers": [
  {
   "url": "https://crm.empiraa.app/api/v1",
   "description": "Production"
  }
 ],
 "security": [
  {
   "bearerAuth": []
  },
  {
   "apiKeyHeader": []
  }
 ],
 "tags": [
  {
   "name": "Users and me"
  },
  {
   "name": "Accounts"
  },
  {
   "name": "Contacts"
  },
  {
   "name": "Deals"
  },
  {
   "name": "Pipelines"
  },
  {
   "name": "Prospect contacts"
  },
  {
   "name": "Prospect Companies"
  },
  {
   "name": "Prospect sources"
  },
  {
   "name": "Activities"
  },
  {
   "name": "Tasks"
  },
  {
   "name": "Calls and call logs"
  },
  {
   "name": "Notes"
  },
  {
   "name": "Bookings"
  },
  {
   "name": "Decks"
  },
  {
   "name": "Portfolio"
  },
  {
   "name": "Marketing Campaigns"
  },
  {
   "name": "Property"
  }
 ],
 "paths": {
  "/": {
   "get": {
    "operationId": "getApiInfo",
    "tags": [
     "Users and me"
    ],
    "summary": "API information",
    "description": "Returns the API name, version and a list of its main endpoints. No key needed.",
    "security": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "version": {
           "type": "string"
          },
          "documentation": {
           "type": "string"
          },
          "endpoints": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/me": {
   "get": {
    "operationId": "getMe",
    "tags": [
     "Users and me"
    ],
    "summary": "Get the key's workspace",
    "description": "Needs any valid API key; no scope required.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Workspace"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/users": {
   "get": {
    "operationId": "listUsers",
    "tags": [
     "Users and me"
    ],
    "summary": "List users",
    "description": "Required scope: `users:read`.",
    "x-required-scope": "users:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/User"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "total": {
             "type": "integer"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   }
  },
  "/users/{id}": {
   "get": {
    "operationId": "getUser",
    "tags": [
     "Users and me"
    ],
    "summary": "Get a user",
    "description": "Required scope: `users:read`.",
    "x-required-scope": "users:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/User"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/accounts": {
   "get": {
    "operationId": "listAccounts",
    "tags": [
     "Accounts"
    ],
    "summary": "List Accounts",
    "description": "Required scope: `accounts:read`.",
    "x-required-scope": "accounts:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Account"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            },
            "total": {
             "type": "integer"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createAccount",
    "tags": [
     "Accounts"
    ],
    "summary": "Create an Account",
    "description": "Required scope: `accounts:write`.",
    "x-required-scope": "accounts:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Account"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/accounts/{id}": {
   "get": {
    "operationId": "getAccount",
    "tags": [
     "Accounts"
    ],
    "summary": "Get an Account",
    "description": "Required scope: `accounts:read`.",
    "x-required-scope": "accounts:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Account"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateAccount",
    "tags": [
     "Accounts"
    ],
    "summary": "Update an Account",
    "description": "Required scope: `accounts:write`.",
    "x-required-scope": "accounts:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Account"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deactivateAccount",
    "tags": [
     "Accounts"
    ],
    "summary": "Deactivate an Account",
    "description": "Marks the Account inactive; it no longer appears in the list.\n\nRequired scope: `accounts:write`.",
    "x-required-scope": "accounts:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/accounts/{id}/spends": {
   "get": {
    "operationId": "listAccountSpends",
    "tags": [
     "Accounts"
    ],
    "summary": "List an Account's spend records",
    "description": "Required scope: `accounts:read`.",
    "x-required-scope": "accounts:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/AccountSpend"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createAccountSpends",
    "tags": [
     "Accounts"
    ],
    "summary": "Add spend records",
    "description": "Required scope: `accounts:write`.",
    "x-required-scope": "accounts:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "oneOf": [
         {
          "$ref": "#/components/schemas/AccountSpendCreate"
         },
         {
          "type": "array",
          "items": {
           "$ref": "#/components/schemas/AccountSpendCreate"
          },
          "minItems": 1,
          "maxItems": 100
         }
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created. A single object returns one spend record; an array returns an array and meta.count.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "oneOf": [
            {
             "$ref": "#/components/schemas/AccountSpend"
            },
            {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/AccountSpend"
             }
            }
           ]
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "count": {
             "type": "integer"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/accounts/{id}/spends/{spendId}": {
   "get": {
    "operationId": "getAccountSpend",
    "tags": [
     "Accounts"
    ],
    "summary": "Get a spend record",
    "description": "Required scope: `accounts:read`.",
    "x-required-scope": "accounts:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     },
     {
      "name": "spendId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountSpend"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateAccountSpend",
    "tags": [
     "Accounts"
    ],
    "summary": "Update a spend record",
    "description": "Required scope: `accounts:write`.",
    "x-required-scope": "accounts:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     },
     {
      "name": "spendId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountSpendUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountSpend"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deleteAccountSpend",
    "tags": [
     "Accounts"
    ],
    "summary": "Delete a spend record",
    "description": "Required scope: `accounts:write`.",
    "x-required-scope": "accounts:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     },
     {
      "name": "spendId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/contacts": {
   "get": {
    "operationId": "listContacts",
    "tags": [
     "Contacts"
    ],
    "summary": "List Contacts",
    "description": "Required scope: `contacts:read`.",
    "x-required-scope": "contacts:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Contact"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            },
            "total": {
             "type": "integer"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createContact",
    "tags": [
     "Contacts"
    ],
    "summary": "Create a Contact",
    "description": "Required scope: `contacts:write`.",
    "x-required-scope": "contacts:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ContactCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Contact"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    },
    "x-webhook-events": [
     "contact.created"
    ]
   }
  },
  "/contacts/{id}": {
   "get": {
    "operationId": "getContact",
    "tags": [
     "Contacts"
    ],
    "summary": "Get a Contact",
    "description": "Required scope: `contacts:read`.",
    "x-required-scope": "contacts:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Contact"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateContact",
    "tags": [
     "Contacts"
    ],
    "summary": "Update a Contact",
    "description": "Required scope: `contacts:write`.",
    "x-required-scope": "contacts:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ContactUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Contact"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deleteContact",
    "tags": [
     "Contacts"
    ],
    "summary": "Delete a Contact",
    "description": "Moves the Contact to Recently deleted for 30 days.\n\nRequired scope: `contacts:write`.",
    "x-required-scope": "contacts:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    },
    "x-webhook-events": [
     "contact.deleted"
    ]
   }
  },
  "/deals": {
   "get": {
    "operationId": "listDeals",
    "tags": [
     "Deals"
    ],
    "summary": "List Deals",
    "description": "Required scope: `deals:read`.",
    "x-required-scope": "deals:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Deal"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createDeal",
    "tags": [
     "Deals"
    ],
    "summary": "Create a Deal",
    "description": "Required scope: `deals:write`.",
    "x-required-scope": "deals:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DealCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Deal"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     },
     "422": {
      "$ref": "#/components/responses/InvalidStage"
     }
    },
    "x-webhook-events": [
     "deal.created"
    ]
   }
  },
  "/deals/{id}": {
   "get": {
    "operationId": "getDeal",
    "tags": [
     "Deals"
    ],
    "summary": "Get a Deal",
    "description": "Required scope: `deals:read`.",
    "x-required-scope": "deals:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Deal"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateDeal",
    "tags": [
     "Deals"
    ],
    "summary": "Update a Deal",
    "description": "Required scope: `deals:write`.",
    "x-required-scope": "deals:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DealUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Deal"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/InvalidStage"
     }
    },
    "x-webhook-events": [
     "deal.won"
    ]
   },
   "delete": {
    "operationId": "deleteDeal",
    "tags": [
     "Deals"
    ],
    "summary": "Delete a Deal",
    "description": "Deletes the Deal permanently.\n\nRequired scope: `deals:write`.",
    "x-required-scope": "deals:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/pipelines": {
   "get": {
    "operationId": "listPipelines",
    "tags": [
     "Pipelines"
    ],
    "summary": "List pipelines",
    "description": "Required scope: `pipeline:read`.",
    "x-required-scope": "pipeline:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Pipeline"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createPipeline",
    "tags": [
     "Pipelines"
    ],
    "summary": "Create a pipeline",
    "description": "Required scope: `pipeline:write`.",
    "x-required-scope": "pipeline:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PipelineCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Pipeline"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   }
  },
  "/pipelines/{id}": {
   "get": {
    "operationId": "getPipeline",
    "tags": [
     "Pipelines"
    ],
    "summary": "Get a pipeline",
    "description": "Required scope: `pipeline:read`.",
    "x-required-scope": "pipeline:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Pipeline"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updatePipeline",
    "tags": [
     "Pipelines"
    ],
    "summary": "Update a pipeline",
    "description": "Required scope: `pipeline:write`.",
    "x-required-scope": "pipeline:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PipelineUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Pipeline"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deletePipeline",
    "tags": [
     "Pipelines"
    ],
    "summary": "Delete a pipeline",
    "description": "The default pipeline, and pipelines that still have Deals, can't be deleted.\n\nRequired scope: `pipeline:write`.",
    "x-required-scope": "pipeline:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "500": {
      "$ref": "#/components/responses/ServerError"
     }
    }
   }
  },
  "/prospects": {
   "get": {
    "operationId": "listProspects",
    "tags": [
     "Prospect contacts"
    ],
    "summary": "List prospect contacts",
    "description": "Required scope: `prospects:read`.",
    "x-required-scope": "prospects:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Prospect"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            },
            "total": {
             "type": "integer"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "upsertProspect",
    "tags": [
     "Prospect contacts"
    ],
    "summary": "Create or update a prospect contact",
    "description": "Required scope: `prospects:write`.",
    "x-required-scope": "prospects:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProspectUpsert"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Matched an existing prospect contact by email and updated it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProspectUpsertResult"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "201": {
      "description": "Created a new prospect contact.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProspectUpsertResult"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    },
    "x-webhook-events": [
     "prospect.created",
     "prospect.updated"
    ]
   }
  },
  "/prospects/{id}": {
   "get": {
    "operationId": "getProspect",
    "tags": [
     "Prospect contacts"
    ],
    "summary": "Get a prospect contact",
    "description": "Required scope: `prospects:read`.",
    "x-required-scope": "prospects:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Prospect"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateProspect",
    "tags": [
     "Prospect contacts"
    ],
    "summary": "Update a prospect contact",
    "description": "Required scope: `prospects:write`.",
    "x-required-scope": "prospects:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProspectUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Prospect"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    },
    "x-webhook-events": [
     "prospect.updated"
    ]
   },
   "delete": {
    "operationId": "deleteProspect",
    "tags": [
     "Prospect contacts"
    ],
    "summary": "Delete a prospect contact",
    "description": "Moves the prospect contact to Recently deleted for 30 days.\n\nRequired scope: `prospects:write`.",
    "x-required-scope": "prospects:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    },
    "x-webhook-events": [
     "prospect.deleted"
    ]
   }
  },
  "/prospect-companies": {
   "get": {
    "operationId": "listProspectCompanies",
    "tags": [
     "Prospect Companies"
    ],
    "summary": "List Prospect Companies",
    "description": "Uses offset pagination.\n\nRequired scope: `prospects:read`.",
    "x-required-scope": "prospects:read",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 200,
       "default": 50
      },
      "description": "Up to 200. Default 50."
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 0,
       "default": 0
      },
      "description": "Records to skip. Default 0."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/ProspectCompany"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "total": {
             "type": "integer"
            },
            "limit": {
             "type": "integer"
            },
            "offset": {
             "type": "integer"
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createProspectCompany",
    "tags": [
     "Prospect Companies"
    ],
    "summary": "Create a Prospect Company",
    "description": "Required scope: `prospects:write`.",
    "x-required-scope": "prospects:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProspectCompanyCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProspectCompany"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/prospect-companies/{id}": {
   "get": {
    "operationId": "getProspectCompany",
    "tags": [
     "Prospect Companies"
    ],
    "summary": "Get a Prospect Company",
    "description": "Required scope: `prospects:read`.",
    "x-required-scope": "prospects:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProspectCompany"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateProspectCompany",
    "tags": [
     "Prospect Companies"
    ],
    "summary": "Update a Prospect Company",
    "description": "Required scope: `prospects:write`.",
    "x-required-scope": "prospects:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProspectCompanyUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProspectCompany"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deleteProspectCompany",
    "tags": [
     "Prospect Companies"
    ],
    "summary": "Delete a Prospect Company",
    "description": "Required scope: `prospects:write`.",
    "x-required-scope": "prospects:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/prospect-sources": {
   "get": {
    "operationId": "listProspectSources",
    "tags": [
     "Prospect sources"
    ],
    "summary": "List prospect sources",
    "description": "Returns Signal's standard sources.\n\nRequired scope: `prospects:read`.",
    "x-required-scope": "prospects:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/ProspectSource"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   }
  },
  "/prospect-sources/{id}": {
   "get": {
    "operationId": "getProspectSource",
    "tags": [
     "Prospect sources"
    ],
    "summary": "Get a prospect source",
    "description": "Required scope: `prospects:read`.",
    "x-required-scope": "prospects:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProspectSource"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/activities": {
   "get": {
    "operationId": "listActivities",
    "tags": [
     "Activities"
    ],
    "summary": "List activities",
    "description": "Required scope: `activities:read`.",
    "x-required-scope": "activities:read",
    "parameters": [
     {
      "name": "deal_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "contact_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "prospect_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "account_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Activity"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createActivity",
    "tags": [
     "Activities"
    ],
    "summary": "Create an activity",
    "description": "Actions are activities with type_id rat_action.\n\nRequired scope: `activities:write`.",
    "x-required-scope": "activities:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ActivityCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Activity"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/activities/{id}": {
   "get": {
    "operationId": "getActivity",
    "tags": [
     "Activities"
    ],
    "summary": "Get an activity",
    "description": "Required scope: `activities:read`.",
    "x-required-scope": "activities:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Activity"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateActivity",
    "tags": [
     "Activities"
    ],
    "summary": "Update an activity",
    "description": "Required scope: `activities:write`.",
    "x-required-scope": "activities:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ActivityUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Activity"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deleteActivity",
    "tags": [
     "Activities"
    ],
    "summary": "Delete an activity",
    "description": "Required scope: `activities:write`.",
    "x-required-scope": "activities:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/tasks": {
   "get": {
    "operationId": "listTasks",
    "tags": [
     "Tasks"
    ],
    "summary": "List tasks",
    "description": "Required scope: `tasks:read`.",
    "x-required-scope": "tasks:read",
    "parameters": [
     {
      "name": "deal_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "contact_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "account_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "prospect_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "owner_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "is_completed",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "true for completed only; any other value for open only."
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Task"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createTask",
    "tags": [
     "Tasks"
    ],
    "summary": "Create a task",
    "description": "Required scope: `tasks:write`.",
    "x-required-scope": "tasks:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TaskCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Task"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/tasks/{id}": {
   "get": {
    "operationId": "getTask",
    "tags": [
     "Tasks"
    ],
    "summary": "Get a task",
    "description": "Required scope: `tasks:read`.",
    "x-required-scope": "tasks:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Task"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateTask",
    "tags": [
     "Tasks"
    ],
    "summary": "Update a task",
    "description": "Required scope: `tasks:write`.",
    "x-required-scope": "tasks:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TaskUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Task"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deleteTask",
    "tags": [
     "Tasks"
    ],
    "summary": "Delete a task",
    "description": "Required scope: `tasks:write`.",
    "x-required-scope": "tasks:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/calls": {
   "get": {
    "operationId": "listCalls",
    "tags": [
     "Calls and call logs"
    ],
    "summary": "List calls",
    "description": "Required scope: `activities:read`.",
    "x-required-scope": "activities:read",
    "parameters": [
     {
      "name": "contact_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "deal_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "prospect_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "owner_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Call"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "logCall",
    "tags": [
     "Calls and call logs"
    ],
    "summary": "Log a call",
    "description": "Required scope: `activities:write`.",
    "x-required-scope": "activities:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CallCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Call"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/calls/{id}": {
   "get": {
    "operationId": "getCall",
    "tags": [
     "Calls and call logs"
    ],
    "summary": "Get a call",
    "description": "Required scope: `activities:read`.",
    "x-required-scope": "activities:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Call"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/call-logs": {
   "post": {
    "operationId": "logCallLegacy",
    "tags": [
     "Calls and call logs"
    ],
    "summary": "Log a call (original endpoint)",
    "description": "Same as POST /calls, without checking that linked records belong to the workspace. Prefer POST /calls.\n\nRequired scope: `activities:write`.",
    "x-required-scope": "activities:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CallCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Call"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/notes": {
   "get": {
    "operationId": "listNotes",
    "tags": [
     "Notes"
    ],
    "summary": "List notes",
    "description": "Required scope: `notes:read`.",
    "x-required-scope": "notes:read",
    "parameters": [
     {
      "name": "prospect_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Note"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createNote",
    "tags": [
     "Notes"
    ],
    "summary": "Add a note",
    "description": "Required scope: `notes:write`.",
    "x-required-scope": "notes:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/NoteCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Note"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/notes/{id}": {
   "get": {
    "operationId": "getNote",
    "tags": [
     "Notes"
    ],
    "summary": "Get a note",
    "description": "Required scope: `notes:read`.",
    "x-required-scope": "notes:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Note"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateNote",
    "tags": [
     "Notes"
    ],
    "summary": "Edit a note",
    "description": "Required scope: `notes:write`.",
    "x-required-scope": "notes:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/NoteUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Note"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deleteNote",
    "tags": [
     "Notes"
    ],
    "summary": "Delete a note",
    "description": "Required scope: `notes:write`.",
    "x-required-scope": "notes:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/bookings": {
   "get": {
    "operationId": "listBookings",
    "tags": [
     "Bookings"
    ],
    "summary": "List bookings",
    "description": "Required scope: `bookings:read`.",
    "x-required-scope": "bookings:read",
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "contact_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "deal_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "owner_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Booking"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createBooking",
    "tags": [
     "Bookings"
    ],
    "summary": "Record a booking",
    "description": "Required scope: `bookings:write`.",
    "x-required-scope": "bookings:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BookingCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Booking"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/bookings/{id}": {
   "get": {
    "operationId": "getBooking",
    "tags": [
     "Bookings"
    ],
    "summary": "Get a booking",
    "description": "Required scope: `bookings:read`.",
    "x-required-scope": "bookings:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Booking"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateBooking",
    "tags": [
     "Bookings"
    ],
    "summary": "Update a booking",
    "description": "Required scope: `bookings:write`.",
    "x-required-scope": "bookings:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BookingUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Booking"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "cancelBooking",
    "tags": [
     "Bookings"
    ],
    "summary": "Cancel a booking",
    "description": "Sets status to cancelled; the booking is kept.\n\nRequired scope: `bookings:write`.",
    "x-required-scope": "bookings:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/decks": {
   "get": {
    "operationId": "listDecks",
    "tags": [
     "Decks"
    ],
    "summary": "List Decks",
    "description": "Required scope: `decks:read`.",
    "x-required-scope": "decks:read",
    "parameters": [
     {
      "name": "owner_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Deck"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createDeck",
    "tags": [
     "Decks"
    ],
    "summary": "Create a Deck",
    "description": "Create a blank Deck (title), copy one (template_deck_id), personalize a copy (template_deck_id, personalise: true, prospect_id) or build one from a questionnaire (generate_from_questionnaire: true, prospect_id).\n\nRequired scope: `decks:write`.",
    "x-required-scope": "decks:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DeckCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Deck"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "500": {
      "$ref": "#/components/responses/ServerError"
     }
    }
   }
  },
  "/decks/{id}": {
   "get": {
    "operationId": "getDeck",
    "tags": [
     "Decks"
    ],
    "summary": "Get a Deck",
    "description": "Required scope: `decks:read`.",
    "x-required-scope": "decks:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Deck"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateDeck",
    "tags": [
     "Decks"
    ],
    "summary": "Update a Deck",
    "description": "Required scope: `decks:write`.",
    "x-required-scope": "decks:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DeckUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Deck"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deleteDeck",
    "tags": [
     "Decks"
    ],
    "summary": "Delete a Deck",
    "description": "Required scope: `decks:write`.",
    "x-required-scope": "decks:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/portfolio": {
   "get": {
    "operationId": "getPortfolio",
    "tags": [
     "Portfolio"
    ],
    "summary": "Get portfolio figures",
    "description": "Required scope: `portfolio:read`.",
    "x-required-scope": "portfolio:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Portfolio"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   }
  },
  "/marketing/campaigns": {
   "get": {
    "operationId": "listCampaigns",
    "tags": [
     "Marketing Campaigns"
    ],
    "summary": "List Campaigns",
    "description": "Needs a plan that includes Marketing. Archived Campaigns are listed only with status=archived.\n\nRequired scope: `marketing:read`.",
    "x-required-scope": "marketing:read",
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "draft",
        "live",
        "scheduled",
        "sending",
        "sent",
        "archived"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Campaign"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            },
            "truncated": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "description": "Insufficient scope (problem details), or the plan doesn't include Marketing (PlanFeatureError).",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       },
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PlanFeatureError"
        }
       }
      }
     },
     "503": {
      "description": "The plan couldn't be checked.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PlanFeatureError"
        }
       }
      }
     }
    }
   }
  },
  "/property/developments": {
   "get": {
    "operationId": "listDevelopments",
    "tags": [
     "Property"
    ],
    "summary": "List developments",
    "description": "Required scope: `property:read`.",
    "x-required-scope": "property:read",
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Development"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createDevelopment",
    "tags": [
     "Property"
    ],
    "summary": "Create a development",
    "description": "Required scope: `property:write`.",
    "x-required-scope": "property:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DevelopmentCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Development"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "x-webhook-events": [
     "development.created"
    ]
   }
  },
  "/property/developments/{id}": {
   "get": {
    "operationId": "getDevelopment",
    "tags": [
     "Property"
    ],
    "summary": "Get a development",
    "description": "Required scope: `property:read`.",
    "x-required-scope": "property:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Development"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateDevelopment",
    "tags": [
     "Property"
    ],
    "summary": "Update a development",
    "description": "Required scope: `property:write`.",
    "x-required-scope": "property:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DevelopmentUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Development"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    },
    "x-webhook-events": [
     "development.updated"
    ]
   },
   "delete": {
    "operationId": "deleteDevelopment",
    "tags": [
     "Property"
    ],
    "summary": "Delete a development",
    "description": "A development with call-offs can't be deleted (409).\n\nRequired scope: `property:write`.",
    "x-required-scope": "property:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/property/plots": {
   "get": {
    "operationId": "listPlots",
    "tags": [
     "Property"
    ],
    "summary": "List plots",
    "description": "Required scope: `property:read`.",
    "x-required-scope": "property:read",
    "parameters": [
     {
      "name": "development_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Plot"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createPlot",
    "tags": [
     "Property"
    ],
    "summary": "Create a plot",
    "description": "Required scope: `property:write`.",
    "x-required-scope": "property:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PlotCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Plot"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    },
    "x-webhook-events": [
     "plot.created"
    ]
   }
  },
  "/property/plots/{id}": {
   "get": {
    "operationId": "getPlot",
    "tags": [
     "Property"
    ],
    "summary": "Get a plot",
    "description": "Required scope: `property:read`.",
    "x-required-scope": "property:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Plot"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updatePlot",
    "tags": [
     "Property"
    ],
    "summary": "Update a plot",
    "description": "Required scope: `property:write`.",
    "x-required-scope": "property:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PlotUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Plot"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    },
    "x-webhook-events": [
     "plot.updated",
     "plot.status_changed"
    ]
   },
   "delete": {
    "operationId": "deletePlot",
    "tags": [
     "Property"
    ],
    "summary": "Delete a plot",
    "description": "A plot on a call-off can't be deleted (409).\n\nRequired scope: `property:write`.",
    "x-required-scope": "property:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/property/reservations": {
   "get": {
    "operationId": "listReservations",
    "tags": [
     "Property"
    ],
    "summary": "List reservations",
    "description": "Required scope: `property:read`.",
    "x-required-scope": "property:read",
    "parameters": [
     {
      "name": "plot_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "contact_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Reservation"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "createReservation",
    "tags": [
     "Property"
    ],
    "summary": "Create a reservation",
    "description": "Sets the plot's status to reserved.\n\nRequired scope: `property:write`.",
    "x-required-scope": "property:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReservationCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Reservation"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/property/reservations/{id}": {
   "get": {
    "operationId": "getReservation",
    "tags": [
     "Property"
    ],
    "summary": "Get a reservation",
    "description": "Required scope: `property:read`.",
    "x-required-scope": "property:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Reservation"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "updateReservation",
    "tags": [
     "Property"
    ],
    "summary": "Update a reservation",
    "description": "Required scope: `property:write`.",
    "x-required-scope": "property:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReservationUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Reservation"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "cancelReservation",
    "tags": [
     "Property"
    ],
    "summary": "Cancel a reservation",
    "description": "Sets status to cancelled and the plot back to available.\n\nRequired scope: `property:write`.",
    "x-required-scope": "property:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "204": {
      "$ref": "#/components/responses/NoContent"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/property/call-offs": {
   "get": {
    "operationId": "listCallOffs",
    "tags": [
     "Property"
    ],
    "summary": "List call-offs",
    "description": "Required scope: `property:read`.",
    "x-required-scope": "property:read",
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "booked",
        "checked",
        "scheduled",
        "dispatched",
        "invoiced",
        "paid",
        "canceled"
       ]
      }
     },
     {
      "name": "statuses",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Comma-separated statuses."
     },
     {
      "name": "development_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "dispatch_from",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "YYYY-MM-DD"
     },
     {
      "name": "dispatch_to",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "YYYY-MM-DD"
     },
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/CallOff"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            },
            "hasMore": {
             "type": "boolean"
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    }
   },
   "post": {
    "operationId": "bookCallOff",
    "tags": [
     "Property"
    ],
    "summary": "Book a call-off",
    "description": "Book a development call-off (development_id and plots) or a bulk call-off (account_id, description and value). Unknown fields are refused.\n\nRequired scope: `property:write`.",
    "x-required-scope": "property:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "oneOf": [
         {
          "$ref": "#/components/schemas/CallOffBookDevelopment"
         },
         {
          "$ref": "#/components/schemas/CallOffBookBulk"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CallOff"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/property/call-offs/{id}": {
   "get": {
    "operationId": "getCallOff",
    "tags": [
     "Property"
    ],
    "summary": "Get a call-off",
    "description": "Required scope: `property:read`.",
    "x-required-scope": "property:read",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CallOff"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "recordCallOffBilling",
    "tags": [
     "Property"
    ],
    "summary": "Record an invoice or payment",
    "description": "Required scope: `property:write`.",
    "x-required-scope": "property:write",
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CallOffRecord"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta",
          "error"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CallOff"
          },
          "meta": {
           "type": "object",
           "properties": {
            "cursor": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "cursor"
           ]
          },
          "error": {
           "type": "null"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer",
    "description": "Authorization: Bearer YOUR_API_KEY (keys start with sk_live_)."
   },
   "apiKeyHeader": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key",
    "description": "X-API-Key: YOUR_API_KEY"
   }
  },
  "parameters": {
   "Id": {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
     "type": "string"
    }
   },
   "Limit": {
    "name": "limit",
    "in": "query",
    "required": false,
    "description": "Records per page, 1 to 100.",
    "schema": {
     "type": "integer",
     "minimum": 1,
     "maximum": 100,
     "default": 20
    }
   },
   "Cursor": {
    "name": "cursor",
    "in": "query",
    "required": false,
    "description": "meta.cursor from the previous page.",
    "schema": {
     "type": "string"
    }
   },
   "IdempotencyKey": {
    "name": "Idempotency-Key",
    "in": "header",
    "required": false,
    "description": "Unique value; retries with the same key within 24 hours return the first response.",
    "schema": {
     "type": "string"
    }
   }
  },
  "responses": {
   "NoContent": {
    "description": "No Content"
   },
   "BadRequest": {
    "description": "Invalid request (INVALID_REQUEST, NO_QUESTIONNAIRE_FIELDS).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "Unauthorized": {
    "description": "Missing or invalid API key (MISSING_API_KEY, INVALID_API_KEY).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "PaymentRequired": {
    "description": "The workspace's subscription doesn't allow changes (WORKSPACE_PAYMENT_REQUIRED).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "Forbidden": {
    "description": "The key lacks the required scope (INSUFFICIENT_SCOPE).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "NotFound": {
    "description": "The record, or a record it refers to, isn't in this workspace (NOT_FOUND).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "Conflict": {
    "description": "CONFLICT (problem details), or IDEMPOTENCY_IN_PROGRESS (envelope).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     },
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/IdempotencyInProgress"
      }
     }
    }
   },
   "InvalidStage": {
    "description": "stage_id isn't a stage of the Deal's pipeline (INVALID_STAGE).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "ServerError": {
    "description": "Server error (SERVER_ERROR, CREATE_FAILED, PERSONALISE_FAILED).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   }
  },
  "schemas": {
   "Problem": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "description": "URI naming the error."
     },
     "title": {
      "type": "string"
     },
     "status": {
      "type": "integer"
     },
     "code": {
      "type": "string",
      "description": "Stable machine-readable code."
     },
     "detail": {
      "type": "string"
     }
    },
    "required": [
     "type",
     "title",
     "status",
     "code"
    ],
    "description": "Problem details (RFC 9457)."
   },
   "PlanFeatureError": {
    "type": "object",
    "properties": {
     "error": {
      "type": "string"
     },
     "code": {
      "type": "string",
      "enum": [
       "PLAN_FEATURE_REQUIRED",
       "FEATURE_CHECK_ERROR"
      ]
     },
     "feature": {
      "type": "string"
     },
     "planName": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "error",
     "code"
    ]
   },
   "IdempotencyInProgress": {
    "type": "object",
    "properties": {
     "data": {
      "type": "null"
     },
     "meta": {
      "type": "object"
     },
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string",
        "enum": [
         "IDEMPOTENCY_IN_PROGRESS"
        ]
       },
       "message": {
        "type": "string"
       }
      },
      "required": [
       "code",
       "message"
      ]
     }
    },
    "required": [
     "data",
     "meta",
     "error"
    ]
   },
   "Workspace": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "slug": {
      "type": "string"
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "website": {
      "type": [
       "string",
       "null"
      ]
     },
     "timezone": {
      "type": [
       "string",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "description": "ISO 4217 code."
     },
     "logo_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "User": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "User ID."
     },
     "name": {
      "type": "string"
     },
     "email": {
      "type": "string"
     },
     "job_title": {
      "type": [
       "string",
       "null"
      ]
     },
     "avatar_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "is_active": {
      "type": "boolean"
     },
     "role": {
      "type": "string",
      "description": "Role display name."
     },
     "role_code": {
      "type": [
       "string",
       "null"
      ]
     },
     "member_id": {
      "type": "string"
     },
     "joined_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     }
    }
   },
   "Account": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string"
     },
     "legal_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "website": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "industry": {
      "type": [
       "string",
       "null"
      ]
     },
     "employee_count": {
      "type": [
       "integer",
       "null"
      ]
     },
     "health_score": {
      "type": [
       "integer",
       "null"
      ]
     },
     "status_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "Read-only."
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "territory": {
      "type": [
       "string",
       "null"
      ]
     },
     "tier": {
      "type": [
       "string",
       "null"
      ],
      "description": "Read-only."
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "AccountCreate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "legal_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "website": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "industry": {
      "type": [
       "string",
       "null"
      ]
     },
     "employee_count": {
      "type": [
       "integer",
       "null"
      ]
     },
     "territory": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "name"
    ]
   },
   "AccountUpdate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "legal_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "website": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "industry": {
      "type": [
       "string",
       "null"
      ]
     },
     "employee_count": {
      "type": [
       "integer",
       "null"
      ]
     },
     "territory": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "health_score": {
      "type": [
       "integer",
       "null"
      ]
     }
    }
   },
   "AccountSpend": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "account_id": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "amount": {
      "type": "number"
     },
     "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
     },
     "spend_date": {
      "type": "string",
      "format": "date-time"
     },
     "category": {
      "type": [
       "string",
       "null"
      ]
     },
     "reference": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "AccountSpendCreate": {
    "type": "object",
    "properties": {
     "description": {
      "type": "string"
     },
     "amount": {
      "type": "number"
     },
     "spend_date": {
      "type": "string",
      "description": "ISO 8601 date or timestamp."
     },
     "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "description": "Three letters. Stored as GBP when omitted."
     },
     "category": {
      "type": [
       "string",
       "null"
      ]
     },
     "reference": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "description",
     "amount",
     "spend_date"
    ]
   },
   "AccountSpendUpdate": {
    "type": "object",
    "properties": {
     "description": {
      "type": "string"
     },
     "amount": {
      "type": "number"
     },
     "spend_date": {
      "type": "string"
     },
     "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
     },
     "category": {
      "type": [
       "string",
       "null"
      ]
     },
     "reference": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Contact": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "first_name": {
      "type": "string"
     },
     "last_name": {
      "type": "string"
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "mobile": {
      "type": [
       "string",
       "null"
      ]
     },
     "job_title": {
      "type": [
       "string",
       "null"
      ]
     },
     "department": {
      "type": [
       "string",
       "null"
      ]
     },
     "linkedin_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": "string"
     },
     "is_primary": {
      "type": "boolean"
     },
     "is_champion": {
      "type": "boolean"
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "ContactCreate": {
    "type": "object",
    "properties": {
     "account_id": {
      "type": "string"
     },
     "first_name": {
      "type": "string"
     },
     "last_name": {
      "type": "string"
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "mobile": {
      "type": [
       "string",
       "null"
      ]
     },
     "job_title": {
      "type": [
       "string",
       "null"
      ]
     },
     "department": {
      "type": [
       "string",
       "null"
      ]
     },
     "linkedin_url": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "account_id"
    ]
   },
   "ContactUpdate": {
    "type": "object",
    "properties": {
     "first_name": {
      "type": "string"
     },
     "last_name": {
      "type": "string"
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "job_title": {
      "type": [
       "string",
       "null"
      ]
     },
     "department": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Deal": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string"
     },
     "value": {
      "type": [
       "number",
       "null"
      ]
     },
     "value_period": {
      "type": "string",
      "enum": [
       "once_off",
       "monthly",
       "quarterly",
       "yearly"
      ]
     },
     "probability": {
      "type": [
       "integer",
       "null"
      ]
     },
     "expected_close_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "actual_close_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "stage_id": {
      "type": "string",
      "description": "Deal stage ID (not a pipeline stage id)."
     },
     "account_id": {
      "type": "string"
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "pipeline_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "DealCreate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "account_id": {
      "type": "string"
     },
     "stage_id": {
      "type": "string"
     },
     "pipeline_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "value": {
      "type": [
       "number",
       "null"
      ]
     },
     "value_period": {
      "type": "string",
      "enum": [
       "once_off",
       "monthly",
       "quarterly",
       "yearly"
      ],
      "default": "once_off"
     },
     "probability": {
      "type": "integer",
      "description": "Default 50."
     },
     "expected_close_at": {
      "type": [
       "string",
       "null"
      ],
      "description": "ISO 8601."
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "name",
     "account_id",
     "stage_id"
    ]
   },
   "DealUpdate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "value": {
      "type": [
       "number",
       "null"
      ]
     },
     "probability": {
      "type": "integer"
     },
     "stage_id": {
      "type": "string"
     },
     "expected_close_at": {
      "type": [
       "string",
       "null"
      ],
      "description": "ISO 8601."
     }
    }
   },
   "PipelineStage": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "code": {
      "type": "string"
     },
     "sort_order": {
      "type": "integer"
     },
     "is_won": {
      "type": "boolean"
     },
     "is_lost": {
      "type": "boolean"
     }
    }
   },
   "Pipeline": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "is_default": {
      "type": "boolean"
     },
     "stages": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/PipelineStage"
      }
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "PipelineCreate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "stages": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "name": {
         "type": "string"
        },
        "code": {
         "type": "string"
        },
        "sort_order": {
         "type": "integer"
        },
        "is_won": {
         "type": "boolean"
        },
        "is_lost": {
         "type": "boolean"
        }
       },
       "required": [
        "name",
        "code"
       ]
      },
      "description": "Omit to create a pipeline with no stages."
     }
    },
    "required": [
     "name"
    ]
   },
   "PipelineUpdate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Prospect": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "first_name": {
      "type": "string"
     },
     "last_name": {
      "type": "string"
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "job_title": {
      "type": [
       "string",
       "null"
      ]
     },
     "linkedin_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "stage_id": {
      "type": "string",
      "examples": [
       "rps_new",
       "rps_contacted",
       "rps_qualified",
       "rps_converted",
       "rps_disqualified"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "Assigned To."
     },
     "lead_company_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "converted_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "archived_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     },
     "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom fields keyed by internal name."
     }
    }
   },
   "ProspectUpsertResult": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Prospect"
     },
     {
      "type": "object",
      "properties": {
       "_action": {
        "type": "string",
        "enum": [
         "created",
         "updated"
        ]
       }
      },
      "required": [
       "_action"
      ]
     }
    ]
   },
   "ProspectUpsert": {
    "type": "object",
    "properties": {
     "first_name": {
      "type": "string"
     },
     "last_name": {
      "type": "string"
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "job_title": {
      "type": [
       "string",
       "null"
      ]
     },
     "linkedin_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "stage_id": {
      "type": "string"
     },
     "source_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "lead_company_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": "string",
      "description": "Added as a new note. Blank is ignored."
     },
     "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom fields keyed by internal name."
     },
     "username": {
      "type": "string",
      "description": "Used as first_name when no name is sent."
     }
    },
    "description": "Matches an existing prospect contact by email. Unrecognized fields matching a custom field's internal name are saved as custom fields.",
    "additionalProperties": true
   },
   "ProspectUpdate": {
    "type": "object",
    "properties": {
     "first_name": {
      "type": "string"
     },
     "last_name": {
      "type": "string"
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "job_title": {
      "type": [
       "string",
       "null"
      ]
     },
     "linkedin_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "stage_id": {
      "type": "string"
     },
     "source_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "lead_company_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": "string",
      "description": "Added as a new note. Blank is ignored."
     },
     "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom fields keyed by internal name."
     }
    },
    "additionalProperties": true
   },
   "ProspectCompany": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "industry": {
      "type": [
       "string",
       "null"
      ]
     },
     "size": {
      "type": [
       "string",
       "null"
      ]
     },
     "revenue": {
      "type": [
       "string",
       "null"
      ]
     },
     "location": {
      "type": [
       "string",
       "null"
      ]
     },
     "website": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "address": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "Assigned To."
     },
     "archived_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "ProspectCompanyCreate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "industry": {
      "type": [
       "string",
       "null"
      ]
     },
     "size": {
      "type": [
       "string",
       "null"
      ]
     },
     "revenue": {
      "type": [
       "string",
       "null"
      ]
     },
     "location": {
      "type": [
       "string",
       "null"
      ]
     },
     "website": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "address": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "name"
    ]
   },
   "ProspectCompanyUpdate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "industry": {
      "type": [
       "string",
       "null"
      ]
     },
     "size": {
      "type": [
       "string",
       "null"
      ]
     },
     "revenue": {
      "type": [
       "string",
       "null"
      ]
     },
     "location": {
      "type": [
       "string",
       "null"
      ]
     },
     "website": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "address": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "ProspectSource": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "code": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "sort_order": {
      "type": "integer"
     },
     "is_active": {
      "type": "boolean"
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "Activity": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "subject": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "type_id": {
      "type": "string",
      "examples": [
       "rat_action",
       "rat_call",
       "rat_email",
       "rat_meeting",
       "rat_linkedin",
       "rat_task",
       "rat_note"
      ]
     },
     "start_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "end_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "is_completed": {
      "type": "boolean"
     },
     "completed_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "outcome": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "assigned_user_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "ActivityCreate": {
    "type": "object",
    "properties": {
     "subject": {
      "type": "string"
     },
     "type_id": {
      "type": "string",
      "examples": [
       "rat_action",
       "rat_call",
       "rat_email",
       "rat_meeting",
       "rat_linkedin",
       "rat_task",
       "rat_note"
      ]
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "start_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "end_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "outcome": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "assigned_user_id": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "subject",
     "type_id"
    ]
   },
   "ActivityUpdate": {
    "type": "object",
    "properties": {
     "subject": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "outcome": {
      "type": [
       "string",
       "null"
      ]
     },
     "start_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "end_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "is_completed": {
      "type": "boolean"
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "assigned_user_id": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Task": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "due_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "priority": {
      "type": [
       "string",
       "null"
      ]
     },
     "is_completed": {
      "type": "boolean"
     },
     "completed_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "status_id": {
      "type": [
       "string",
       "null"
      ],
      "examples": [
       "rts_todo",
       "rts_in_progress",
       "rts_blocked",
       "rts_done",
       "rts_cancelled"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "TaskCreate": {
    "type": "object",
    "properties": {
     "title": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "due_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "priority": {
      "type": [
       "string",
       "null"
      ]
     },
     "status_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "title"
    ]
   },
   "TaskUpdate": {
    "type": "object",
    "properties": {
     "title": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "due_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "priority": {
      "type": [
       "string",
       "null"
      ]
     },
     "status_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "is_completed": {
      "type": "boolean"
     }
    }
   },
   "Call": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "subject": {
      "type": "string"
     },
     "direction": {
      "type": [
       "string",
       "null"
      ],
      "examples": [
       "outbound",
       "inbound"
      ]
     },
     "duration_seconds": {
      "type": [
       "integer",
       "null"
      ]
     },
     "outcome": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "CallCreate": {
    "type": "object",
    "properties": {
     "subject": {
      "type": "string"
     },
     "direction": {
      "type": [
       "string",
       "null"
      ]
     },
     "duration_seconds": {
      "type": [
       "integer",
       "null"
      ]
     },
     "outcome": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "subject"
    ]
   },
   "Note": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "prospect_id": {
      "type": "string"
     },
     "content": {
      "type": "string"
     },
     "created_by": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "NoteCreate": {
    "type": "object",
    "properties": {
     "prospect_id": {
      "type": "string"
     },
     "content": {
      "type": "string"
     },
     "created_by": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "prospect_id",
     "content"
    ]
   },
   "NoteUpdate": {
    "type": "object",
    "properties": {
     "content": {
      "type": "string"
     }
    }
   },
   "Booking": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "title": {
      "type": [
       "string",
       "null"
      ]
     },
     "invitee_name": {
      "type": "string"
     },
     "invitee_email": {
      "type": [
       "string",
       "null"
      ]
     },
     "invitee_phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "start_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "end_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "duration": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Minutes."
     },
     "status": {
      "type": [
       "string",
       "null"
      ],
      "examples": [
       "scheduled",
       "rescheduled",
       "cancelled"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "event_type_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "timezone": {
      "type": [
       "string",
       "null"
      ]
     },
     "location_type": {
      "type": [
       "string",
       "null"
      ]
     },
     "location_details": {
      "type": [
       "string",
       "null"
      ]
     },
     "cancelled_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "cancel_reason": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "BookingCreate": {
    "type": "object",
    "properties": {
     "invitee_name": {
      "type": "string"
     },
     "title": {
      "type": [
       "string",
       "null"
      ]
     },
     "invitee_email": {
      "type": [
       "string",
       "null"
      ]
     },
     "invitee_phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "start_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "end_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "duration": {
      "type": [
       "integer",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "event_type_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "timezone": {
      "type": [
       "string",
       "null"
      ],
      "description": "Defaults to UTC."
     },
     "location_type": {
      "type": [
       "string",
       "null"
      ]
     },
     "location_details": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "invitee_name"
    ]
   },
   "BookingUpdate": {
    "type": "object",
    "properties": {
     "title": {
      "type": [
       "string",
       "null"
      ]
     },
     "invitee_name": {
      "type": "string"
     },
     "invitee_email": {
      "type": [
       "string",
       "null"
      ]
     },
     "invitee_phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "start_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "end_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "duration": {
      "type": [
       "integer",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "location_type": {
      "type": [
       "string",
       "null"
      ]
     },
     "location_details": {
      "type": [
       "string",
       "null"
      ]
     },
     "cancel_reason": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Deck": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "number": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "orientation": {
      "type": "string",
      "enum": [
       "landscape",
       "portrait"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "status_id": {
      "type": "string",
      "examples": [
       "rds_draft",
       "rds_sent",
       "rds_viewed",
       "rds_accepted",
       "rds_archived"
      ]
     },
     "is_live": {
      "type": "boolean"
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "plot_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "development_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "sent_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "viewed_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "folder": {
      "type": [
       "string",
       "null"
      ]
     },
     "slug": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "DeckCreate": {
    "type": "object",
    "properties": {
     "title": {
      "type": "string",
      "description": "Required for a blank Deck."
     },
     "template_deck_id": {
      "type": "string"
     },
     "personalise": {
      "type": "boolean"
     },
     "generate_from_questionnaire": {
      "type": "boolean"
     },
     "orientation": {
      "type": "string",
      "enum": [
       "landscape",
       "portrait"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "status_id": {
      "type": "string"
     },
     "is_live": {
      "type": "boolean"
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "plot_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "development_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "DeckUpdate": {
    "type": "object",
    "properties": {
     "title": {
      "type": "string"
     },
     "orientation": {
      "type": "string",
      "enum": [
       "landscape",
       "portrait"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "status_id": {
      "type": "string"
     },
     "is_live": {
      "type": "boolean"
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deal_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "prospect_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "plot_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "development_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "folder": {
      "type": [
       "string",
       "null"
      ]
     },
     "slug": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Portfolio": {
    "type": "object",
    "properties": {
     "totalPipeline": {
      "type": "number"
     },
     "wonRevenue": {
      "type": "number"
     },
     "lostRevenue": {
      "type": "number"
     },
     "avgDealSize": {
      "type": "number"
     },
     "winRate": {
      "type": "number"
     },
     "totalDeals": {
      "type": "integer"
     },
     "openDeals": {
      "type": "integer"
     },
     "wonDeals": {
      "type": "integer"
     },
     "lostDeals": {
      "type": "integer"
     },
     "accountsTotal": {
      "type": "integer"
     },
     "prospectsTotal": {
      "type": "integer"
     },
     "activitiesThisMonth": {
      "type": "integer"
     }
    },
    "description": "Returned in camelCase, unlike the rest of the API."
   },
   "Campaign": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "enum": [
       "draft",
       "live",
       "scheduled",
       "sending",
       "sent",
       "archived"
      ]
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "goal": {
      "type": [
       "string",
       "null"
      ]
     },
     "starts_on": {
      "type": [
       "string",
       "null"
      ]
     },
     "ends_on": {
      "type": [
       "string",
       "null"
      ]
     },
     "assigned_to_user_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "assigned_to_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "archived": {
      "type": "boolean"
     },
     "email_total": {
      "type": "integer"
     },
     "email_counts": {
      "type": "object",
      "properties": {
       "draft": {
        "type": "integer"
       },
       "scheduled": {
        "type": "integer"
       },
       "sending": {
        "type": "integer"
       },
       "paused": {
        "type": "integer"
       },
       "sent": {
        "type": "integer"
       },
       "cancelled": {
        "type": "integer"
       }
      }
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "Development": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "location": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": "string"
     },
     "launch_date": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "completion_date": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "image_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "order_number": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 100
     },
     "file_path": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 1000
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     },
     "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom fields keyed by internal name."
     }
    }
   },
   "DevelopmentCreate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "location": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "launch_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "completion_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "image_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "order_number": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 100
     },
     "file_path": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 1000
     },
     "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom fields keyed by internal name."
     }
    },
    "required": [
     "name"
    ],
    "additionalProperties": true
   },
   "DevelopmentUpdate": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "location": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "launch_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "completion_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "image_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "order_number": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 100
     },
     "file_path": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 1000
     },
     "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom fields keyed by internal name."
     }
    },
    "additionalProperties": true
   },
   "Plot": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "development_id": {
      "type": "string"
     },
     "plot_number": {
      "type": "string"
     },
     "property_type": {
      "type": [
       "string",
       "null"
      ]
     },
     "bedrooms": {
      "type": [
       "integer",
       "null"
      ]
     },
     "bathrooms": {
      "type": [
       "number",
       "null"
      ]
     },
     "sqft": {
      "type": [
       "number",
       "null"
      ]
     },
     "price": {
      "type": "number"
     },
     "status": {
      "type": "string",
      "examples": [
       "available",
       "reserved",
       "sold",
       "unavailable"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "image_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "website_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     },
     "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom fields keyed by internal name."
     }
    }
   },
   "PlotCreate": {
    "type": "object",
    "properties": {
     "development_id": {
      "type": "string"
     },
     "plot_number": {
      "type": "string"
     },
     "property_type": {
      "type": [
       "string",
       "null"
      ]
     },
     "bedrooms": {
      "type": [
       "integer",
       "null"
      ]
     },
     "bathrooms": {
      "type": [
       "number",
       "null"
      ]
     },
     "sqft": {
      "type": [
       "number",
       "null"
      ]
     },
     "price": {
      "type": "number"
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "image_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "website_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom fields keyed by internal name."
     }
    },
    "required": [
     "development_id",
     "plot_number"
    ],
    "additionalProperties": true
   },
   "PlotUpdate": {
    "type": "object",
    "properties": {
     "plot_number": {
      "type": "string"
     },
     "property_type": {
      "type": [
       "string",
       "null"
      ]
     },
     "bedrooms": {
      "type": [
       "integer",
       "null"
      ]
     },
     "bathrooms": {
      "type": [
       "number",
       "null"
      ]
     },
     "sqft": {
      "type": [
       "number",
       "null"
      ]
     },
     "price": {
      "type": "number"
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "image_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "website_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom fields keyed by internal name."
     }
    },
    "additionalProperties": true
   },
   "Reservation": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "plot_id": {
      "type": "string"
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "buyer_name": {
      "type": "string"
     },
     "deposit_amount": {
      "type": "number"
     },
     "total_price": {
      "type": "number"
     },
     "reserved_at": {
      "type": "string",
      "format": "date-time"
     },
     "expires_at": {
      "type": "string",
      "format": "date-time"
     },
     "status": {
      "type": "string",
      "examples": [
       "active",
       "cancelled"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "ReservationCreate": {
    "type": "object",
    "properties": {
     "plot_id": {
      "type": "string"
     },
     "buyer_name": {
      "type": "string"
     },
     "expires_at": {
      "type": "string"
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deposit_amount": {
      "type": "number"
     },
     "total_price": {
      "type": "number"
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "plot_id",
     "buyer_name",
     "expires_at"
    ]
   },
   "ReservationUpdate": {
    "type": "object",
    "properties": {
     "buyer_name": {
      "type": "string"
     },
     "contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "deposit_amount": {
      "type": "number"
     },
     "total_price": {
      "type": "number"
     },
     "expires_at": {
      "type": "string"
     },
     "status": {
      "type": "string"
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "CallOff": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "reference": {
      "type": "string"
     },
     "number": {
      "type": "integer"
     },
     "development_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "development_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "developer_account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "developer_account_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "client_order_number": {
      "type": [
       "string",
       "null"
      ]
     },
     "requested_by_contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "requested_by_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "requested_by_email": {
      "type": [
       "string",
       "null"
      ]
     },
     "requested_by_phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "requested_at": {
      "type": "string",
      "format": "date-time"
     },
     "required_by": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     },
     "status": {
      "type": "string",
      "enum": [
       "booked",
       "checked",
       "scheduled",
       "dispatched",
       "invoiced",
       "paid",
       "canceled"
      ]
     },
     "stage": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "reservation",
       "completion",
       null
      ]
     },
     "value": {
      "type": "number"
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "plots": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "id": {
         "type": "string"
        },
        "plot_number": {
         "type": "string"
        },
        "price": {
         "type": "number"
        }
       }
      }
     },
     "booked_plot_numbers": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "created_by_user_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "checked_by_user_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "checked_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "dispatch_date": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     },
     "dispatched_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "invoice_number": {
      "type": [
       "string",
       "null"
      ]
     },
     "invoiced_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "paid_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "canceled_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "CallOffBookDevelopment": {
    "type": "object",
    "properties": {
     "development_id": {
      "type": "string"
     },
     "plots": {
      "type": "string",
      "description": "Such as \"10-25, 30\"."
     },
     "stage": {
      "type": "string",
      "enum": [
       "reservation",
       "completion"
      ],
      "default": "reservation"
     },
     "create_missing_plots": {
      "type": "boolean"
     },
     "requested_by_contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "requested_at": {
      "type": "string"
     },
     "required_by": {
      "type": "string",
      "format": "date"
     },
     "client_order_number": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 100
     },
     "notes": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 2000
     }
    },
    "required": [
     "development_id",
     "plots"
    ],
    "additionalProperties": false
   },
   "CallOffBookBulk": {
    "type": "object",
    "properties": {
     "account_id": {
      "type": "string"
     },
     "description": {
      "type": "string",
      "maxLength": 500
     },
     "value": {
      "type": "number"
     },
     "requested_by_contact_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "requested_at": {
      "type": "string"
     },
     "required_by": {
      "type": "string",
      "format": "date"
     },
     "client_order_number": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 100
     },
     "notes": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 2000
     }
    },
    "required": [
     "account_id",
     "description",
     "value"
    ],
    "additionalProperties": false
   },
   "CallOffRecord": {
    "type": "object",
    "properties": {
     "invoice_number": {
      "type": "string",
      "maxLength": 100
     },
     "invoiced_at": {
      "type": "string"
     },
     "paid_at": {
      "type": "string"
     },
     "paid": {
      "type": "boolean",
      "enum": [
       true
      ]
     }
    },
    "description": "Send invoice_number to record an invoice, paid_at or paid: true to record a payment, or both.",
    "additionalProperties": false
   }
  }
 }
}